{"id":18033963,"url":"https://github.com/miolab/nx_sandbox","last_synced_at":"2026-05-02T06:44:22.026Z","repository":{"id":49953087,"uuid":"373471103","full_name":"miolab/nx_sandbox","owner":"miolab","description":"Code sandbox for Nx.","archived":false,"fork":false,"pushed_at":"2021-06-08T00:48:39.000Z","size":12,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T22:41:29.246Z","etag":null,"topics":["circleci","docker","elixir","nx"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miolab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-03T10:38:28.000Z","updated_at":"2021-06-07T10:21:32.000Z","dependencies_parsed_at":"2022-08-29T03:22:09.849Z","dependency_job_id":null,"html_url":"https://github.com/miolab/nx_sandbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/miolab/nx_sandbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miolab%2Fnx_sandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miolab%2Fnx_sandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miolab%2Fnx_sandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miolab%2Fnx_sandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miolab","download_url":"https://codeload.github.com/miolab/nx_sandbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miolab%2Fnx_sandbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32525896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circleci","docker","elixir","nx"],"created_at":"2024-10-30T11:09:10.198Z","updated_at":"2026-05-02T06:44:21.994Z","avatar_url":"https://github.com/miolab.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nx Sandbox\n\n[![miolab](https://circleci.com/gh/miolab/nx_sandbox.svg?style=svg)](https://github.com/miolab/nx_sandbox)\n\nCode sandbox for **Nx**.\n\n\u003e Nx is a multi-dimensional tensors library for Elixir with multi-staged compilation to the CPU/GPU.  \n\u003e (https://github.com/elixir-nx/nx)\n\n## Usage\n\n### Set up (Elixir / Erlang OTP)\n\n```sh\n$ docker-compose build\n```\n\n#### **Usage** IEx\n\n```sh\n$ docker-compose up -d\n```\n\n```sh\n$ docker-compose exec app iex\n\nErlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]\nInteractive Elixir (1.12.1) - press Ctrl+C to exit (type h() ENTER for help)\niex(1)\u003e\n```\n\n### Set up (Nx)\n\n- execute `mix new app_name`\n\n  ```sh\n  $ docker-compose run --rm app mix new . --app my_app\n\n  Creating nx_sandbox_app_run ... done\n  * creating README.md\n  * creating .formatter.exs\n  * creating .gitignore\n  * creating mix.exs\n  * creating lib\n  * creating lib/my_app.ex\n  * creating test\n  * creating test/test_helper.exs\n  * creating test/my_app_test.exs\n\n  Your Mix project was created successfully.\n  You can use \"mix\" to compile it, test it, and more:\n\n      mix test\n\n  Run \"mix help\" for more commands.\n  ```\n\n- update file `mix.exs`\n\n  ```elixir\n  defp deps do\n    [\n      {:nx, \"~\u003e 0.1.0-dev\", github: \"elixir-nx/nx\", branch: \"main\", sparse: \"nx\"}  # --\u003e add\n      ...\n  ```\n\n- execute `mix deps.get`\n\n  ```sh\n  $ docker-compose run --rm app mix deps.get\n\n  Creating nx_sandbox_app_run ... done\n  * Getting nx (https://github.com/elixir-nx/nx.git - origin/ main)\n  remote: Enumerating objects: 9111, done.\n  remote: Counting objects: 100% (1317/1317), done.\n  remote: Compressing objects: 100% (668/668), done.\n  remote: Total 9111 (delta 770), reused 1103 (delta 621),  pack-reused 7794\n  Receiving objects: 100% (9111/9111), 40.19 MiB | 1.97 MiB/  s, done.\n  Resolving deltas: 100% (5937/5937), done.\n  ```\n\n- execute `mix test`\n\n  ```sh\n  $ docker-compose run --rm app mix test\n\n  Creating nx_sandbox_app_run ... done\n  ==\u003e nx\n  Compiling 20 files (.ex)\n  Generated nx app\n  ==\u003e my_app\n  Compiling 1 file (.ex)\n  Generated my_app app\n  ..\n\n  Finished in 0.06 seconds (0.00s async, 0.06s sync)\n  1 doctest, 1 test, 0 failures\n\n  Randomized with seed 559301\n  ```\n\n### **Usage** Nx with IEx\n\n```sh\n$ docker-compose up -d\n\n$ docker-compose exec app iex -S mix\n\nErlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:4:4] [ds:4:4:10]   [async-threads:1] [jit]\n\n==\u003e nx\nCompiling 20 files (.ex)\nGenerated nx app\n==\u003e my_app\nCompiling 1 file (.ex)\nGenerated my_app app\nInteractive Elixir (1.12.1) - press Ctrl+C to exit (type h() ENTER for help)\n\niex(1)\u003et = Nx.tensor([[1, 2], [3, 4]])\n#Nx.Tensor\u003c\n  s64[2][2]\n  [\n    [1, 2],\n    [3, 4]\n  ]\n\u003e\niex(2)\u003e Nx.shape(t)\n{2, 2}\n\u003e\niex(3)\u003e Nx.divide(Nx.exp(t), Nx.sum(Nx.exp(t)))\n#Nx.Tensor\u003c\n  f32[2][2]\n  [\n    [0.032058604061603546, 0.08714432269334793],\n    [0.23688282072544098, 0.6439142227172852]\n  ]\n\u003e\n```\n\n---\n\n## Ref\n\nhttps://hub.docker.com/_/elixir\n\nhttps://github.com/elixir-nx/livebook\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiolab%2Fnx_sandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiolab%2Fnx_sandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiolab%2Fnx_sandbox/lists"}