Organisationsahrefsocannla74ec4 ()fedora-42-5.3_opam-2.3

fedora-42-5.3_opam-2.3

Link Copied
Code Copied

Logs

2025-07-05 10:45.45: New job: test ahrefs/ocannl https://github.com/ahrefs/ocannl.git#refs/heads/master (a74ec4010364ca6624256354e2e124ce0b614814) (linux-x86_64:fedora-42-5.3_opam-2.3)
Base: ocaml/opam:fedora-42-ocaml-5.3@sha256:ca935fbf20f8d83e78dff4d973011a91d32565d7d98af772da42600dd103623c
Opam project build


To reproduce locally:


git clone --recursive "https://github.com/ahrefs/ocannl.git" -b "master" && cd "ocannl" && git reset --hard a74ec401
cat > Dockerfile <<'END-OF-DOCKERFILE'
FROM ocaml/opam:fedora-42-ocaml-5.3@sha256:ca935fbf20f8d83e78dff4d973011a91d32565d7d98af772da42600dd103623c
# fedora-42-5.3_opam-2.3
USER 1000:1000
ENV CLICOLOR_FORCE="1"
ENV OPAMCOLOR="always"
WORKDIR /src
RUN sudo dnf install -y findutils
RUN sudo ln -f /usr/bin/opam-2.3 /usr/bin/opam
RUN opam init --reinit -ni
RUN uname -rs && opam exec -- ocaml -version && opam --version
WORKDIR /src
RUN sudo chown opam /src
RUN cd ~/opam-repository && (git cat-file -e 382e02b4c17b5b59d503254784ac3a5d78916d5a || git fetch origin master) && git reset -q --hard 382e02b4c17b5b59d503254784ac3a5d78916d5a && git log --no-decorate -n1 --oneline && opam update -u
COPY --chown=1000:1000 neural_nets_lib.opam arrayjit.opam ./
RUN opam pin add -yn neural_nets_lib.dev './' && \
opam pin add -yn arrayjit.dev './'
RUN echo '(lang dune 3.0)' > './dune-project'
ENV DEPS="angstrom.0.16.1 astring.0.8.5 backoff.0.1.1 base.v0.17.3 base-bigarray.base base-bytes.base base-domains.base base-effects.base base-nnp.base base-threads.base base-unix.base bigarray-compat.1.1.0 bigstringaf.0.10.0 camlp-streams.5.0.1 camlzip.1.13 cmdliner.1.3.0 conf-libcurl.2 conf-libffi.2.0.0 conf-pkg-config.4 conf-zlib.1 cppo.1.8.0 csexp.1.5.2 csv.2.4 ctypes.0.23.0 ctypes-foreign.0.23.0 curl.0.10.0 dune.3.19.1 dune-configurator.3.19.1 fieldslib.v0.17.0 fmt.0.10.0 integers.0.7.0 jane-street-headers.v0.17.0 jst-config.v0.17.0 logs.0.8.0 mdx.2.5.0 mtime.2.1.0 multicore-magic.2.3.1 num.1.6 ocaml.5.3.0 ocaml-base-compiler.5.3.0 ocaml-compiler.5.3.0 ocaml-compiler-libs.v0.17.0 ocaml-config.3 ocaml-options-vanilla.1 ocaml-syntax-shims.1.0.0 ocaml-version.4.0.1 ocaml_intrinsics_kernel.v0.17.1 ocamlbuild.0.16.1 ocamlfind.1.9.8 parsexp.v0.17.0 pprint.20230830 ppx_assert.v0.17.0 ppx_base.v0.17.0 ppx_cold.v0.17.0 ppx_compare.v0.17.0 ppx_derivers.1.2.1 ppx_deriving.6.1.0 ppx_enumerate.v0.17.0 ppx_expect.v0.17.3 ppx_fields_conv.v0.17.0 ppx_globalize.v0.17.2 ppx_hash.v0.17.0 ppx_here.v0.17.0 ppx_inline_test.v0.17.1 ppx_minidebug.2.3.0 ppx_optcomp.v0.17.1 ppx_sexp_conv.v0.17.1 ppx_string.v0.17.0 ppx_variants_conv.v0.17.1 ppxlib.0.36.0 ppxlib_jane.v0.17.4 printbox.0.12 printbox-ext-plot.0.12 printbox-html.0.12 printbox-md.0.12 printbox-text.0.12 ptime.1.2.0 re.1.13.2 result.1.5 saturn_lockfree.0.5.0 seq.base sexplib.v0.17.0 sexplib0.v0.17.0 stdio.v0.17.0 stdlib-shims.0.3.0 thread-local-storage.0.2 time_now.v0.17.0 topkg.1.0.8 tyxml.4.6.0 uucp.16.0.0 uutf.1.0.4 variantslib.v0.17.0"
ENV CI="true"
ENV OCAMLCI="true"
RUN opam update --depexts && opam install --cli=2.3 --depext-only -y neural_nets_lib.dev arrayjit.dev $DEPS
RUN opam install $DEPS
COPY --chown=1000:1000 . /src
RUN opam exec -- dune build @install @check @runtest && rm -rf _build


END-OF-DOCKERFILE
docker build .
END-REPRO-BLOCK


2025-07-05 10:45.45: Using cache hint "ahrefs/ocannl-ocaml/opam:fedora-42-ocaml-5.3@sha256:ca935fbf20f8d83e78dff4d973011a91d32565d7d98af772da42600dd103623c-fedora-42-5.3_opam-2.3-e7b66700cdf32b3cc2b84269e6d26c23"
2025-07-05 10:45.45: Using OBuilder spec:
((from ocaml/opam:fedora-42-ocaml-5.3@sha256:ca935fbf20f8d83e78dff4d973011a91d32565d7d98af772da42600dd103623c)
(comment fedora-42-5.3_opam-2.3)
(user (uid 1000) (gid 1000))
(env CLICOLOR_FORCE 1)
(env OPAMCOLOR always)
(workdir /src)
(run (network host)
(shell "sudo dnf install -y findutils"))
(run (shell "sudo ln -f /usr/bin/opam-2.3 /usr/bin/opam"))
(run (shell "opam init --reinit -ni"))
(run (shell "uname -rs && opam exec -- ocaml -version && opam --version"))
(workdir /src)
(run (shell "sudo chown opam /src"))
(run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "cd ~/opam-repository && (git cat-file -e 382e02b4c17b5b59d503254784ac3a5d78916d5a || git fetch origin master) && git reset -q --hard 382e02b4c17b5b59d503254784ac3a5d78916d5a && git log --no-decorate -n1 --oneline && opam update -u"))
(copy (src neural_nets_lib.opam arrayjit.opam) (dst ./))
(run (network host)
(shell  "opam pin add -yn neural_nets_lib.dev './' && \
\nopam pin add -yn arrayjit.dev './'"))
(run (network host)
(shell "echo '(lang dune 3.0)' > './dune-project'"))
(env DEPS "angstrom.0.16.1 astring.0.8.5 backoff.0.1.1 base.v0.17.3 base-bigarray.base base-bytes.base base-domains.base base-effects.base base-nnp.base base-threads.base base-unix.base bigarray-compat.1.1.0 bigstringaf.0.10.0 camlp-streams.5.0.1 camlzip.1.13 cmdliner.1.3.0 conf-libcurl.2 conf-libffi.2.0.0 conf-pkg-config.4 conf-zlib.1 cppo.1.8.0 csexp.1.5.2 csv.2.4 ctypes.0.23.0 ctypes-foreign.0.23.0 curl.0.10.0 dune.3.19.1 dune-configurator.3.19.1 fieldslib.v0.17.0 fmt.0.10.0 integers.0.7.0 jane-street-headers.v0.17.0 jst-config.v0.17.0 logs.0.8.0 mdx.2.5.0 mtime.2.1.0 multicore-magic.2.3.1 num.1.6 ocaml.5.3.0 ocaml-base-compiler.5.3.0 ocaml-compiler.5.3.0 ocaml-compiler-libs.v0.17.0 ocaml-config.3 ocaml-options-vanilla.1 ocaml-syntax-shims.1.0.0 ocaml-version.4.0.1 ocaml_intrinsics_kernel.v0.17.1 ocamlbuild.0.16.1 ocamlfind.1.9.8 parsexp.v0.17.0 pprint.20230830 ppx_assert.v0.17.0 ppx_base.v0.17.0 ppx_cold.v0.17.0 ppx_compare.v0.17.0 ppx_derivers.1.2.1 ppx_deriving.6.1.0 ppx_enumerate.v0.17.0 ppx_expect.v0.17.3 ppx_fields_conv.v0.17.0 ppx_globalize.v0.17.2 ppx_hash.v0.17.0 ppx_here.v0.17.0 ppx_inline_test.v0.17.1 ppx_minidebug.2.3.0 ppx_optcomp.v0.17.1 ppx_sexp_conv.v0.17.1 ppx_string.v0.17.0 ppx_variants_conv.v0.17.1 ppxlib.0.36.0 ppxlib_jane.v0.17.4 printbox.0.12 printbox-ext-plot.0.12 printbox-html.0.12 printbox-md.0.12 printbox-text.0.12 ptime.1.2.0 re.1.13.2 result.1.5 saturn_lockfree.0.5.0 seq.base sexplib.v0.17.0 sexplib0.v0.17.0 stdio.v0.17.0 stdlib-shims.0.3.0 thread-local-storage.0.2 time_now.v0.17.0 topkg.1.0.8 tyxml.4.6.0 uucp.16.0.0 uutf.1.0.4 variantslib.v0.17.0")
(env CI true)
(env OCAMLCI true)
(run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam update --depexts && opam install --cli=2.3 --depext-only -y neural_nets_lib.dev arrayjit.dev $DEPS"))
(run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam install $DEPS"))
(copy (src .) (dst /src))
(run (shell "opam exec -- dune build @install @check @runtest && rm -rf _build"))
)


2025-07-05 10:45.45: Waiting for resource in pool OCluster
2025-07-05 10:45.46: Waiting for worker…
2025-07-05 10:45.46: Got resource from pool OCluster
Building on odawa.caelum.ci.dev
HEAD is now at 94ba8390 Untested: (1) restoring hosted data initialization; (2) arbitrary tensor expression initialized params; (3) fix in backprop for params (1) restores initialization functionality, but from ndarray, mostly no-copy. (2) allows for wrapping e.g. random sampling tensor expression as a param. (3) prevents backprop into initialization code of params. That code doesn't disappear, can be used manually.
HEAD is now at a74ec401 Untested: factor out the synthetic `half_moons` dataset; by Claude Sonnet


(from ocaml/opam:fedora-42-ocaml-5.3@sha256:ca935fbf20f8d83e78dff4d973011a91d32565d7d98af772da42600dd103623c)
2025-07-05 10:45.47 ---> using "6219cec5618da56ab7f2d1a249180f4afe319ecdd103db509824f628c646fc56" from cache


/: (comment fedora-42-5.3_opam-2.3)


/: (user (uid 1000) (gid 1000))


/: (env CLICOLOR_FORCE 1)


/: (env OPAMCOLOR always)


/: (workdir /src)


/src: (run (network host)
(shell "sudo dnf install -y findutils"))
Updating and loading repositories:
Fedora 42 - x86_64 - Updates           100% |  57.7 KiB/s |  15.8 KiB |  00m00s
Fedora 42 openh264 (From Cisco) - x86_ 100% |   9.7 KiB/s | 986.0   B |  00m00s
Fedora 42 - x86_64                     100% |  72.5 KiB/s |  25.9 KiB |  00m00s
Fedora 42 - x86_64 - Updates           100% |   6.7 MiB/s |   4.4 MiB |  00m01s
Fedora 42 openh264 (From Cisco) - x86_ 100% |   8.2 KiB/s |   5.8 KiB |  00m01s
Repositories loaded.
Package "findutils-1:4.10.0-5.fc42.x86_64" is already installed.


Nothing to do.
2025-07-05 10:45.47 ---> using "b1f0db1fada5631e0e8a089e4b21d3aba9fcebb8766eb6c5a9e6a096ca963ec7" from cache


/src: (run (shell "sudo ln -f /usr/bin/opam-2.3 /usr/bin/opam"))
2025-07-05 10:45.47 ---> using "36f20adfdb7a1fd3920d73b330c5ff2e9a27026c342876b307bcafc268e4eecd" from cache


/src: (run (shell "opam init --reinit -ni"))
Configuring from /home/opam/.opamrc and then from built-in defaults.
Checking for available remotes: rsync and local, git.
- you won't be able to use mercurial repositories unless you install the hg command on your system.
- you won't be able to use darcs repositories unless you install the darcs command on your system.


This development version of opam requires an update to the layout of /home/opam/.opam from version 2.0 to version 2.2, which can't be reverted.
You may want to back it up before going further.


Continue? [y/n] y
[NOTE] The 'jobs' option was reset, its value was 71 and its new value will vary according to the current number of cores on your machine. You can restore the fixed value using:
opam option jobs=71 --global
Format upgrade done.


<><> Updating repositories ><><><><><><><><><><><><><><><><><><><><><><><><><><>
[default] Initialised
2025-07-05 10:45.47 ---> using "183296d1720211aca3f522267709abbd22789de72e87a55022fd39b32feff80b" from cache


/src: (run (shell "uname -rs && opam exec -- ocaml -version && opam --version"))
Linux 6.8.0-60-generic
The OCaml toplevel, version 5.3.0
2.3.0
2025-07-05 10:45.47 ---> using "626b7abede693a100c736148e8f886bf78f49cecf8d70aa67da157cd49d141e7" from cache


/src: (workdir /src)


/src: (run (shell "sudo chown opam /src"))
2025-07-05 10:45.47 ---> using "4994b2b063705049a578a29c9bf8c120bb196e13f645e32fb92443c24d9db643" from cache


/src: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "cd ~/opam-repository && (git cat-file -e 382e02b4c17b5b59d503254784ac3a5d78916d5a || git fetch origin master) && git reset -q --hard 382e02b4c17b5b59d503254784ac3a5d78916d5a && git log --no-decorate -n1 --oneline && opam update -u"))
From https://github.com/ocaml/opam-repository
* branch                  master     -> FETCH_HEAD
bc726805e3..6dea2f9390  master     -> origin/master
382e02b4c1 Merge pull request #28124 from kit-ty-kate/opam-publish-re.1.13.2


<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
[default] synchronised from git+file:///home/opam/opam-repository


Everything as up-to-date as possible (run with --verbose to show unavailable upgrades).
However, you may "opam upgrade" these packages explicitly, which will ask permission to downgrade or uninstall the conflicting packages.
Nothing to do.
# To update the current shell environment, run: eval $(opam env)
2025-07-05 10:45.47 ---> using "76291ffe5761cb804b3e69c5b5aa63678106797cc7792ad7ee81b272a97c48a1" from cache


/src: (copy (src neural_nets_lib.opam arrayjit.opam) (dst ./))
2025-07-05 10:45.47 ---> using "5dfa59aae04d4ce822804fdfd4549c68d887a9f1c5493a52158eb276aac33030" from cache


/src: (run (network host)
(shell  "opam pin add -yn neural_nets_lib.dev './' && \
\nopam pin add -yn arrayjit.dev './'"))
[neural_nets_lib.dev] synchronised (file:///src)
neural_nets_lib is now pinned to file:///src (version dev)
[arrayjit.dev] synchronised (file:///src)
arrayjit is now pinned to file:///src (version dev)
2025-07-05 10:45.47 ---> using "67608df08a3c76b0780750f672e0935089d2ba202fffa94e9cf695af298d2afa" from cache


/src: (run (network host)
(shell "echo '(lang dune 3.0)' > './dune-project'"))
2025-07-05 10:45.47 ---> using "4998d4899f19c255736528f58622bcad3db68852810499a255f3f47222c6a9b4" from cache


/src: (env DEPS "angstrom.0.16.1 astring.0.8.5 backoff.0.1.1 base.v0.17.3 base-bigarray.base base-bytes.base base-domains.base base-effects.base base-nnp.base base-threads.base base-unix.base bigarray-compat.1.1.0 bigstringaf.0.10.0 camlp-streams.5.0.1 camlzip.1.13 cmdliner.1.3.0 conf-libcurl.2 conf-libffi.2.0.0 conf-pkg-config.4 conf-zlib.1 cppo.1.8.0 csexp.1.5.2 csv.2.4 ctypes.0.23.0 ctypes-foreign.0.23.0 curl.0.10.0 dune.3.19.1 dune-configurator.3.19.1 fieldslib.v0.17.0 fmt.0.10.0 integers.0.7.0 jane-street-headers.v0.17.0 jst-config.v0.17.0 logs.0.8.0 mdx.2.5.0 mtime.2.1.0 multicore-magic.2.3.1 num.1.6 ocaml.5.3.0 ocaml-base-compiler.5.3.0 ocaml-compiler.5.3.0 ocaml-compiler-libs.v0.17.0 ocaml-config.3 ocaml-options-vanilla.1 ocaml-syntax-shims.1.0.0 ocaml-version.4.0.1 ocaml_intrinsics_kernel.v0.17.1 ocamlbuild.0.16.1 ocamlfind.1.9.8 parsexp.v0.17.0 pprint.20230830 ppx_assert.v0.17.0 ppx_base.v0.17.0 ppx_cold.v0.17.0 ppx_compare.v0.17.0 ppx_derivers.1.2.1 ppx_deriving.6.1.0 ppx_enumerate.v0.17.0 ppx_expect.v0.17.3 ppx_fields_conv.v0.17.0 ppx_globalize.v0.17.2 ppx_hash.v0.17.0 ppx_here.v0.17.0 ppx_inline_test.v0.17.1 ppx_minidebug.2.3.0 ppx_optcomp.v0.17.1 ppx_sexp_conv.v0.17.1 ppx_string.v0.17.0 ppx_variants_conv.v0.17.1 ppxlib.0.36.0 ppxlib_jane.v0.17.4 printbox.0.12 printbox-ext-plot.0.12 printbox-html.0.12 printbox-md.0.12 printbox-text.0.12 ptime.1.2.0 re.1.13.2 result.1.5 saturn_lockfree.0.5.0 seq.base sexplib.v0.17.0 sexplib0.v0.17.0 stdio.v0.17.0 stdlib-shims.0.3.0 thread-local-storage.0.2 time_now.v0.17.0 topkg.1.0.8 tyxml.4.6.0 uucp.16.0.0 uutf.1.0.4 variantslib.v0.17.0")


/src: (env CI true)


/src: (env OCAMLCI true)


/src: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam update --depexts && opam install --cli=2.3 --depext-only -y neural_nets_lib.dev arrayjit.dev $DEPS"))
+ /usr/sbin/sudo "yum" "makecache"
- Updating and loading repositories:
- Repositories loaded.
- Metadata cache created.


<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><><><>
[arrayjit.dev] synchronised (file:///src)
[neural_nets_lib.dev] synchronised (file:///src)


[NOTE] Package ocaml-options-vanilla is already installed (current version is 1).
[NOTE] Package ocaml-config is already installed (current version is 3).
[NOTE] Package ocaml-compiler is already installed (current version is 5.3.0).
[NOTE] Package ocaml-base-compiler is already installed (current version is 5.3.0).
[NOTE] Package ocaml is already installed (current version is 5.3.0).
[NOTE] Package base-unix is already installed (current version is base).
[NOTE] Package base-threads is already installed (current version is base).
[NOTE] Package base-nnp is already installed (current version is base).
[NOTE] Package base-effects is already installed (current version is base).
[NOTE] Package base-domains is already installed (current version is base).
[NOTE] Package base-bigarray is already installed (current version is base).


The following system packages will first need to be installed:
libcurl-devel libffi-devel zlib-ng-compat-devel


<><> Handling external dependencies <><><><><><><><><><><><><><><><><><><><><><>


+ /usr/sbin/sudo "yum" "install" "-y" "libcurl-devel" "libffi-devel" "zlib-ng-compat-devel"
- Updating and loading repositories:
- Repositories loaded.
- Package                    Arch   Version         Repository                            Size
- Upgrading:
-  krb5-libs                 x86_64 1.21.3-6.fc42   updates                            2.3 MiB
-    replacing krb5-libs     x86_64 1.21.3-5.fc42   b67228ed38864378b0e1f36b75127eab   2.3 MiB
-  libcurl                   x86_64 8.11.1-5.fc42   updates                          834.0 KiB
-    replacing libcurl       x86_64 8.11.1-4.fc42   b67228ed38864378b0e1f36b75127eab 842.1 KiB
-  libssh                    x86_64 0.11.2-1.fc42   updates                          566.7 KiB
-    replacing libssh        x86_64 0.11.1-4.fc42   b67228ed38864378b0e1f36b75127eab 565.5 KiB
-  libssh-config             noarch 0.11.2-1.fc42   updates                          277.0   B
-    replacing libssh-config noarch 0.11.1-4.fc42   b67228ed38864378b0e1f36b75127eab 277.0   B
- Installing:
-  libcurl-devel             x86_64 8.11.1-5.fc42   updates                            1.3 MiB
-  libffi-devel              x86_64 3.4.6-5.fc42    fedora                            33.1 KiB
-  zlib-ng-compat-devel      x86_64 2.2.4-3.fc42    fedora                           107.0 KiB
- Installing dependencies:
-  brotli                    x86_64 1.1.0-6.fc42    fedora                            31.6 KiB
-  brotli-devel              x86_64 1.1.0-6.fc42    fedora                            65.6 KiB
-  cmake-filesystem          x86_64 3.31.6-2.fc42   fedora                             0.0   B
-  keyutils-libs-devel       x86_64 1.6.3-5.fc42    fedora                            48.2 KiB
-  krb5-devel                x86_64 1.21.3-6.fc42   updates                          705.9 KiB
-  libcom_err-devel          x86_64 1.47.2-3.fc42   fedora                            16.7 KiB
-  libidn2-devel             x86_64 2.3.8-1.fc42    fedora                           149.1 KiB
-  libkadm5                  x86_64 1.21.3-6.fc42   updates                          213.9 KiB
-  libnghttp2-devel          x86_64 1.64.0-3.fc42   fedora                           295.4 KiB
-  libpsl-devel              x86_64 0.21.5-5.fc42   fedora                           110.3 KiB
-  libselinux-devel          x86_64 3.8-2.fc42      updates                          126.8 KiB
-  libsepol-devel            x86_64 3.8-1.fc42      fedora                           120.8 KiB
-  libssh-devel              x86_64 0.11.2-1.fc42   updates                          178.0 KiB
-  libverto-devel            x86_64 0.3.2-10.fc42   fedora                            25.7 KiB
-  openssl-devel             x86_64 1:3.2.4-3.fc42  fedora                             4.3 MiB
-  pcre2-devel               x86_64 10.45-1.fc42    fedora                             2.1 MiB
-  pcre2-utf16               x86_64 10.45-1.fc42    fedora                           626.3 KiB
-  pcre2-utf32               x86_64 10.45-1.fc42    fedora                           598.2 KiB
-  publicsuffix-list         noarch 20250616-1.fc42 updates                          332.8 KiB
- 
- Transaction Summary:
-  Installing:        22 packages
-  Upgrading:          4 packages
-  Replacing:          4 packages
- 
- Total size of inbound packages is 7 MiB. Need to download 7 MiB.
- After this operation, 11 MiB extra will be used (install 15 MiB, remove 4 MiB).
- [ 1/26] libffi-devel-0:3.4.6-5.fc42.x86 100% | 282.2 KiB/s |  28.8 KiB |  00m00s
- [ 2/26] zlib-ng-compat-devel-0:2.2.4-3. 100% | 331.3 KiB/s |  38.4 KiB |  00m00s
- [ 3/26] libcurl-devel-0:8.11.1-5.fc42.x 100% |   6.8 MiB/s | 881.9 KiB |  00m00s
- [ 4/26] cmake-filesystem-0:3.31.6-2.fc4 100% | 676.6 KiB/s |  17.6 KiB |  00m00s
- [ 5/26] libkadm5-0:1.21.3-6.fc42.x86_64 100% |   6.8 MiB/s |  76.4 KiB |  00m00s
- [ 6/26] brotli-devel-0:1.1.0-6.fc42.x86 100% |   1.8 MiB/s |  33.9 KiB |  00m00s
- [ 7/26] krb5-devel-0:1.21.3-6.fc42.x86_ 100% |   2.6 MiB/s | 142.5 KiB |  00m00s
- [ 8/26] libssh-devel-0:0.11.2-1.fc42.x8 100% | 988.1 KiB/s |  41.5 KiB |  00m00s
- [ 9/26] brotli-0:1.1.0-6.fc42.x86_64    100% |   1.3 MiB/s |  19.9 KiB |  00m00s
- [10/26] libidn2-devel-0:2.3.8-1.fc42.x8 100% |   2.8 MiB/s |  64.0 KiB |  00m00s
- [11/26] libpsl-devel-0:0.21.5-5.fc42.x8 100% |   1.6 MiB/s |  33.2 KiB |  00m00s
- [12/26] libselinux-devel-0:3.8-2.fc42.x 100% |  12.3 MiB/s | 151.5 KiB |  00m00s
- [13/26] libnghttp2-devel-0:1.64.0-3.fc4 100% | 574.7 KiB/s |  55.7 KiB |  00m00s
- [14/26] keyutils-libs-devel-0:1.6.3-5.f 100% |   6.5 MiB/s |  59.9 KiB |  00m00s
- [15/26] libsepol-devel-0:3.8-1.fc42.x86 100% | 562.9 KiB/s |  48.4 KiB |  00m00s
- [16/26] libcom_err-devel-0:1.47.2-3.fc4 100% | 984.5 KiB/s |  16.7 KiB |  00m00s
- [17/26] publicsuffix-list-0:20250616-1. 100% |   8.0 MiB/s |  89.9 KiB |  00m00s
- [18/26] libverto-devel-0:0.3.2-10.fc42. 100% |   1.1 MiB/s |  14.4 KiB |  00m00s
- [19/26] pcre2-utf16-0:10.45-1.fc42.x86_ 100% |   3.7 MiB/s | 241.9 KiB |  00m00s
- [20/26] pcre2-devel-0:10.45-1.fc42.x86_ 100% |   6.0 MiB/s | 543.4 KiB |  00m00s
- [21/26] pcre2-utf32-0:10.45-1.fc42.x86_ 100% |   6.0 MiB/s | 228.7 KiB |  00m00s
- [22/26] libcurl-0:8.11.1-5.fc42.x86_64  100% |  25.9 MiB/s | 371.7 KiB |  00m00s
- [23/26] libssh-0:0.11.2-1.fc42.x86_64   100% |  13.4 MiB/s | 232.5 KiB |  00m00s
- [24/26] libssh-config-0:0.11.2-1.fc42.n 100% | 804.7 KiB/s |   8.9 KiB |  00m00s
- [25/26] krb5-libs-0:1.21.3-6.fc42.x86_6 100% |  20.1 MiB/s | 759.8 KiB |  00m00s
- [26/26] openssl-devel-1:3.2.4-3.fc42.x8 100% |   9.1 MiB/s |   2.8 MiB |  00m00s
- --------------------------------------------------------------------------------
- [26/26] Total                           100% |   7.3 MiB/s |   6.9 MiB |  00m01s
- Running transaction
- [ 1/32] Verify package files            100% |   1.0 KiB/s |  26.0   B |  00m00s
- [ 2/32] Prepare transaction             100% | 333.0   B/s |  30.0   B |  00m00s
- [ 3/32] Upgrading krb5-libs-0:1.21.3-6. 100% | 163.7 MiB/s |   2.3 MiB |  00m00s
- [ 4/32] Installing cmake-filesystem-0:3 100% |   2.5 MiB/s |   7.6 KiB |  00m00s
- [ 5/32] Installing zlib-ng-compat-devel 100% | 106.0 MiB/s | 108.5 KiB |  00m00s
- [ 6/32] Installing libkadm5-0:1.21.3-6. 100% | 105.4 MiB/s | 215.9 KiB |  00m00s
- [ 7/32] Upgrading libssh-config-0:0.11. 100% |   0.0   B/s | 816.0   B |  00m00s
- [ 8/32] Upgrading libssh-0:0.11.2-1.fc4 100% | 185.2 MiB/s | 568.8 KiB |  00m00s
- [ 9/32] Installing libssh-devel-0:0.11. 100% |  88.2 MiB/s | 180.6 KiB |  00m00s
- [10/32] Upgrading libcurl-0:8.11.1-5.fc 100% | 203.9 MiB/s | 835.1 KiB |  00m00s
- [11/32] Installing pcre2-utf32-0:10.45- 100% | 195.0 MiB/s | 599.1 KiB |  00m00s
- [12/32] Installing pcre2-utf16-0:10.45- 100% | 204.1 MiB/s | 627.1 KiB |  00m00s
- [13/32] Installing pcre2-devel-0:10.45- 100% | 116.3 MiB/s |   2.1 MiB |  00m00s
- [14/32] Installing publicsuffix-list-0: 100% | 163.0 MiB/s | 333.8 KiB |  00m00s
- [15/32] Installing libpsl-devel-0:0.21. 100% | 110.9 MiB/s | 113.6 KiB |  00m00s
- [16/32] Installing libverto-devel-0:0.3 100% |  25.7 MiB/s |  26.4 KiB |  00m00s
- [17/32] Installing libcom_err-devel-0:1 100% |   1.3 MiB/s |  18.3 KiB |  00m00s
- [18/32] Installing keyutils-libs-devel- 100% |  53.9 MiB/s |  55.2 KiB |  00m00s
- [19/32] Installing libsepol-devel-0:3.8 100% |  31.3 MiB/s | 128.3 KiB |  00m00s
- [20/32] Installing libselinux-devel-0:3 100% |  52.6 MiB/s | 161.6 KiB |  00m00s
- [21/32] Installing krb5-devel-0:1.21.3- 100% |  27.9 MiB/s | 715.2 KiB |  00m00s
- [22/32] Installing openssl-devel-1:3.2. 100% | 144.2 MiB/s |   5.2 MiB |  00m00s
- [23/32] Installing libnghttp2-devel-0:1 100% | 289.5 MiB/s | 296.5 KiB |  00m00s
- [24/32] Installing libidn2-devel-0:2.3. 100% | 153.0 MiB/s | 156.7 KiB |  00m00s
- [25/32] Installing brotli-0:1.1.0-6.fc4 100% |   2.4 MiB/s |  32.3 KiB |  00m00s
- [26/32] Installing brotli-devel-0:1.1.0 100% |  22.1 MiB/s |  68.0 KiB |  00m00s
- [27/32] Installing libcurl-devel-0:8.11 100% |  71.6 MiB/s |   1.4 MiB |  00m00s
- [28/32] Installing libffi-devel-0:3.4.6 100% |  34.0 MiB/s |  34.8 KiB |  00m00s
- [29/32] Removing libcurl-0:8.11.1-4.fc4 100% |   6.8 KiB/s |   7.0   B |  00m00s
- [30/32] Removing libssh-0:0.11.1-4.fc42 100% |  13.7 KiB/s |  14.0   B |  00m00s
- [31/32] Removing libssh-config-0:0.11.1 100% |   0.0   B/s |   3.0   B |  00m00s
- [32/32] Removing krb5-libs-0:1.21.3-5.f 100% |   1.0 KiB/s |  64.0   B |  00m00s
- Complete!
+ /usr/sbin/rpm "-q" "--whatprovides" "libcurl-devel" "libffi-devel" "zlib-ng-compat-devel"
- libcurl-devel-8.11.1-5.fc42.x86_64
- libffi-devel-3.4.6-5.fc42.x86_64
- zlib-ng-compat-devel-2.2.4-3.fc42.x86_64
2025-07-05 10:45.47 ---> using "73933c20356ea20f61bc2b18618136fbb16ce17095bffd50dee8e99c56a7f609" from cache


/src: (run (cache (opam-archives (target /home/opam/.opam/download-cache)))
(network host)
(shell "opam install $DEPS"))
[NOTE] Package ocaml-options-vanilla is already installed (current version is 1).
[NOTE] Package ocaml-config is already installed (current version is 3).
[NOTE] Package ocaml-compiler is already installed (current version is 5.3.0).
[NOTE] Package ocaml-base-compiler is already installed (current version is 5.3.0).
[NOTE] Package ocaml is already installed (current version is 5.3.0).
[NOTE] Package base-unix is already installed (current version is base).
[NOTE] Package base-threads is already installed (current version is base).
[NOTE] Package base-nnp is already installed (current version is base).
[NOTE] Package base-effects is already installed (current version is base).
[NOTE] Package base-domains is already installed (current version is base).
[NOTE] Package base-bigarray is already installed (current version is base).
The following actions will be performed:
=== install 81 packages
- install angstrom                0.16.1
- install astring                 0.8.5
- install backoff                 0.1.1
- install base                    v0.17.3
- install base-bytes              base
- install bigarray-compat         1.1.0
- install bigstringaf             0.10.0
- install camlp-streams           5.0.1
- install camlzip                 1.13
- install cmdliner                1.3.0
- install conf-libcurl            2
- install conf-libffi             2.0.0
- install conf-pkg-config         4
- install conf-zlib               1
- install cppo                    1.8.0
- install csexp                   1.5.2
- install csv                     2.4
- install ctypes                  0.23.0
- install ctypes-foreign          0.23.0
- install curl                    0.10.0
- install dune                    3.19.1
- install dune-configurator       3.19.1
- install fieldslib               v0.17.0
- install fmt                     0.10.0
- install integers                0.7.0
- install jane-street-headers     v0.17.0
- install jst-config              v0.17.0
- install logs                    0.8.0
- install mdx                     2.5.0
- install mtime                   2.1.0
- install multicore-magic         2.3.1
- install num                     1.6
- install ocaml-compiler-libs     v0.17.0
- install ocaml-syntax-shims      1.0.0
- install ocaml-version           4.0.1
- install ocaml_intrinsics_kernel v0.17.1
- install ocamlbuild              0.16.1
- install ocamlfind               1.9.8
- install parsexp                 v0.17.0
- install pprint                  20230830
- install ppx_assert              v0.17.0
- install ppx_base                v0.17.0
- install ppx_cold                v0.17.0
- install ppx_compare             v0.17.0
- install ppx_derivers            1.2.1
- install ppx_deriving            6.1.0
- install ppx_enumerate           v0.17.0
- install ppx_expect              v0.17.3
- install ppx_fields_conv         v0.17.0
- install ppx_globalize           v0.17.2
- install ppx_hash                v0.17.0
- install ppx_here                v0.17.0
- install ppx_inline_test         v0.17.1
- install ppx_minidebug           2.3.0
- install ppx_optcomp             v0.17.1
- install ppx_sexp_conv           v0.17.1
- install ppx_string              v0.17.0
- install ppx_variants_conv       v0.17.1
- install ppxlib                  0.36.0
- install ppxlib_jane             v0.17.4
- install printbox                0.12
- install printbox-ext-plot       0.12
- install printbox-html           0.12
- install printbox-md             0.12
- install printbox-text           0.12
- install ptime                   1.2.0
- install re                      1.13.2
- install result                  1.5
- install saturn_lockfree         0.5.0
- install seq                     base
- install sexplib                 v0.17.0
- install sexplib0                v0.17.0
- install stdio                   v0.17.0
- install stdlib-shims            0.3.0
- install thread-local-storage    0.2
- install time_now                v0.17.0
- install topkg                   1.0.8
- install tyxml                   4.6.0
- install uucp                    16.0.0
- install uutf                    1.0.4
- install variantslib             v0.17.0


<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> retrieved backoff.0.1.1  (cached)
-> retrieved astring.0.8.5  (cached)
-> retrieved angstrom.0.16.1  (cached)
-> retrieved base.v0.17.3  (cached)
-> retrieved bigarray-compat.1.1.0  (cached)
-> retrieved bigstringaf.0.10.0  (cached)
-> retrieved camlp-streams.5.0.1  (cached)
-> retrieved camlzip.1.13  (cached)
-> retrieved cmdliner.1.3.0  (cached)
-> retrieved cppo.1.8.0  (cached)
-> installed conf-libcurl.2
-> installed conf-pkg-config.4
-> retrieved csexp.1.5.2  (cached)
-> retrieved csv.2.4  (cached)
-> retrieved ctypes.0.23.0, ctypes-foreign.0.23.0  (cached)
-> installed conf-libffi.2.0.0
-> installed conf-zlib.1
-> retrieved curl.0.10.0  (cached)
-> retrieved fieldslib.v0.17.0  (cached)
-> retrieved fmt.0.10.0  (cached)
-> retrieved integers.0.7.0  (cached)
-> retrieved jane-street-headers.v0.17.0  (cached)
-> retrieved jst-config.v0.17.0  (cached)
-> retrieved logs.0.8.0  (cached)
-> retrieved mtime.2.1.0  (cached)
-> retrieved multicore-magic.2.3.1  (cached)
-> retrieved mdx.2.5.0  (cached)
-> retrieved num.1.6  (cached)
-> retrieved ocaml-compiler-libs.v0.17.0  (cached)
-> retrieved ocaml-syntax-shims.1.0.0  (cached)
-> retrieved ocaml-version.4.0.1  (cached)
-> retrieved ocaml_intrinsics_kernel.v0.17.1  (cached)
-> retrieved ocamlbuild.0.16.1  (cached)
-> retrieved ocamlfind.1.9.8  (cached)
-> retrieved dune.3.19.1, dune-configurator.3.19.1  (cached)
-> retrieved parsexp.v0.17.0  (cached)
-> retrieved pprint.20230830  (cached)
-> retrieved ppx_assert.v0.17.0  (cached)
-> retrieved ppx_base.v0.17.0  (cached)
-> retrieved ppx_cold.v0.17.0  (cached)
-> retrieved ppx_compare.v0.17.0  (cached)
-> retrieved ppx_derivers.1.2.1  (cached)
-> retrieved ppx_enumerate.v0.17.0  (cached)
-> retrieved ppx_deriving.6.1.0  (cached)
-> retrieved ppx_expect.v0.17.3  (cached)
-> retrieved ppx_fields_conv.v0.17.0  (cached)
-> installed cmdliner.1.3.0
-> installed num.1.6
-> retrieved ppx_globalize.v0.17.2  (cached)
-> retrieved ppx_hash.v0.17.0  (cached)
-> retrieved ppx_here.v0.17.0  (cached)
-> retrieved ppx_inline_test.v0.17.1  (cached)
-> retrieved ppx_optcomp.v0.17.1  (cached)
-> retrieved ppx_sexp_conv.v0.17.1  (cached)
-> retrieved ppx_string.v0.17.0  (cached)
-> retrieved ppx_variants_conv.v0.17.1  (cached)
-> retrieved ppx_minidebug.2.3.0  (cached)
-> retrieved ppxlib_jane.v0.17.4  (cached)
-> retrieved ptime.1.2.0  (cached)
-> retrieved re.1.13.2  (cached)
-> retrieved result.1.5  (cached)
-> retrieved ppxlib.0.36.0  (cached)
-> retrieved seq.base  (cached)
-> installed seq.base
-> retrieved printbox.0.12, printbox-ext-plot.0.12, printbox-html.0.12, printbox-md.0.12, printbox-text.0.12  (cached)
-> retrieved saturn_lockfree.0.5.0  (cached)
-> retrieved sexplib.v0.17.0  (cached)
-> retrieved sexplib0.v0.17.0  (cached)
-> retrieved stdio.v0.17.0  (cached)
-> retrieved stdlib-shims.0.3.0  (cached)
-> retrieved thread-local-storage.0.2  (cached)
-> retrieved time_now.v0.17.0  (cached)
-> retrieved topkg.1.0.8  (cached)
-> retrieved tyxml.4.6.0  (cached)
-> retrieved uutf.1.0.4  (cached)
-> retrieved variantslib.v0.17.0  (cached)
-> retrieved uucp.16.0.0  (cached)
-> installed ocamlfind.1.9.8
-> installed base-bytes.base
-> installed camlzip.1.13
-> installed ocamlbuild.0.16.1
-> installed topkg.1.0.8
-> installed uutf.1.0.4
-> installed mtime.2.1.0
-> installed fmt.0.10.0
-> installed ptime.1.2.0
-> installed astring.0.8.5
-> installed logs.0.8.0
-> installed dune.3.19.1
-> installed jane-street-headers.v0.17.0
-> installed ppx_derivers.1.2.1
-> installed csexp.1.5.2
-> installed backoff.0.1.1
-> installed bigarray-compat.1.1.0
-> installed camlp-streams.5.0.1
-> installed cppo.1.8.0
-> installed csv.2.4
-> installed multicore-magic.2.3.1
-> installed ocaml-compiler-libs.v0.17.0
-> installed ocaml-syntax-shims.1.0.0
-> installed ocaml-version.4.0.1
-> installed ocaml_intrinsics_kernel.v0.17.1
-> installed pprint.20230830
-> installed printbox.0.12
-> installed re.1.13.2
-> installed result.1.5
-> installed sexplib0.v0.17.0
-> installed stdlib-shims.0.3.0
-> installed thread-local-storage.0.2
-> installed saturn_lockfree.0.5.0
-> installed integers.0.7.0
-> installed parsexp.v0.17.0
-> installed dune-configurator.3.19.1
-> installed bigstringaf.0.10.0
-> installed mdx.2.5.0
-> installed sexplib.v0.17.0
-> installed angstrom.0.16.1
-> installed tyxml.4.6.0
-> installed printbox-html.0.12
-> installed curl.0.10.0
-> installed ctypes.0.23.0
-> installed base.v0.17.3
-> installed variantslib.v0.17.0
-> installed fieldslib.v0.17.0
-> installed stdio.v0.17.0
-> installed ctypes-foreign.0.23.0
-> installed uucp.16.0.0
-> installed printbox-text.0.12
-> installed printbox-md.0.12
-> installed printbox-ext-plot.0.12
-> installed ppxlib.0.36.0
-> installed ppx_optcomp.v0.17.1
-> installed ppxlib_jane.v0.17.4
-> installed ppx_cold.v0.17.0
-> installed ppx_here.v0.17.0
-> installed ppx_variants_conv.v0.17.1
-> installed ppx_fields_conv.v0.17.0
-> installed ppx_enumerate.v0.17.0
-> installed ppx_globalize.v0.17.2
-> installed ppx_deriving.6.1.0
-> installed ppx_compare.v0.17.0
-> installed ppx_sexp_conv.v0.17.1
-> installed ppx_hash.v0.17.0
-> installed ppx_assert.v0.17.0
-> installed ppx_minidebug.2.3.0
-> installed ppx_base.v0.17.0
-> installed jst-config.v0.17.0
-> installed ppx_string.v0.17.0
-> installed time_now.v0.17.0
-> installed ppx_inline_test.v0.17.1
-> installed ppx_expect.v0.17.3
Done.
# To update the current shell environment, run: eval $(opam env)
2025-07-05 10:45.47 ---> using "39ca1a6e0388255732b1b6eb3c6b137d8362f5f67537d7c8b6a55177c2e3638c" from cache


/src: (copy (src .) (dst /src))
2025-07-05 10:45.47 ---> saved as "ec893ceee63f3b4f0ae805e269b2bd8d4c65bf4a35470ccc8ff47dbb34a1acfb"


/src: (run (shell "opam exec -- dune build @install @check @runtest && rm -rf _build"))
File "arrayjit/test/dune", line 6, characters 7-15:
6 |   (pps ppx_jane)))
^^^^^^^^
Error: Library "ppx_jane" not found.
-> required by
_build/default/arrayjit/test/.merlin-conf/exe-test_numerical_types
-> required by alias arrayjit/test/check
(cd _build/default/test/config && ../../arrayjit/bin/read_config.exe --read=backend)


Welcome to OCANNL! Reading configuration defaults from /src/_build/default/test/config/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
Wrote value of 'backend' to ocannl_backend.txt
File "test_ppx/test_ppx_op_expected.ml", line 1, characters 0-0:
/usr/sbin/git --no-pager diff --no-index --color=always -u _build/default/test_ppx/test_ppx_op_expected.ml _build/default/test_ppx/test_ppx_op_actual.ml
diff --git a/_build/default/test_ppx/test_ppx_op_expected.ml b/_build/default/test_ppx/test_ppx_op_actual.ml
index a6aa4ae..c971ef0 100644
--- a/_build/default/test_ppx/test_ppx_op_expected.ml
+++ b/_build/default/test_ppx/test_ppx_op_actual.ml
@@ -2,20 +2,20 @@ open Base
open Ocannl
module TDSL = Operation.TDSL
let y0 =
-  let hey1 = TDSL.param ?values:None "hey1" in
+  let hey1 = TDSL.param ?value:None "hey1" in
let open! TDSL.O in
((+) ?label:(Some ["y0"]))
((( *. ) ?label:None) (TDSL.number (Float.of_int 2)) hey1)
(TDSL.number (Float.of_int 3))
let y1 =
-  let hey2 = TDSL.param ?values:None "hey2" in
+  let hey2 = TDSL.param ?value:None "hey2" in
let open! TDSL.O in
fun x ->
((+) ?label:(Some
(List.concat [["y1"]; (x.Tensor.value).Ir.Tnode.label])))
((( * ) ?label:None) hey2 (TDSL.number (Float.of_int 2))) x
let y2 =
-  let hey3 = TDSL.param ?values:None "hey3" in
+  let hey3 = TDSL.param ?value:None "hey3" in
let open! TDSL.O in
fun x1 x2 ->
((+) ?label:(Some
@@ -36,14 +36,14 @@ let b =
~output_dims:[2]
[|(Float.of_int 7);(Float.of_int 8);(Float.of_int 9);(Float.of_int 10)|]
let y =
-  let hey4 = TDSL.param ?values:None "hey4" in
+  let hey4 = TDSL.param ?value:None "hey4" in
let open! TDSL.O in
((+) ?label:(Some ["y"]))
((( * ) ?label:None) hey4 (TDSL.number ?label:None ~axis_label:"q" 2.0))
(TDSL.number ?label:None ~axis_label:"p" 1.0)
let z =
-  let hey5 = TDSL.param ?values:None "hey5"
-  and hey6 = TDSL.param ?values:None "hey6" in
+  let hey5 = TDSL.param ?value:None "hey5"
+  and hey6 = TDSL.param ?value:None "hey6" in
let open! TDSL.O in
((+) ?label:(Some ["z"]))
((( * ) ?label:None) (TDSL.number ?label:None ~axis_label:"q" 2.0) hey5)
@@ -51,8 +51,8 @@ let z =
let stride = 2
and dilation = 3
let z2 =
-  let hey7 = TDSL.param ?values:None "hey7"
-  and hey8 = TDSL.param ?values:None "hey8" in
+  let hey7 = TDSL.param ?value:None "hey7"
+  and hey8 = TDSL.param ?value:None "hey8" in
let open! TDSL.O in
TDSL.einsum ?label:(Some ["z2"])
(String.concat ~sep:""
@@ -61,8 +61,8 @@ let z2 =
let z3 =
let s = 2
and d = 3 in
-  let hey10 = TDSL.param ?values:None "hey10"
-  and hey9 = TDSL.param ?values:None "hey9" in
+  let hey10 = TDSL.param ?value:None "hey10"
+  and hey9 = TDSL.param ?value:None "hey9" in
let open! TDSL.O in
TDSL.einsum ?label:(Some [])
(String.concat ~sep:""
@@ -78,7 +78,7 @@ let mlp_layer =
let b =
(TDSL.param ~more_label:(config.label)) ~output_dims:[config.hid_dim]
"b"
-      and w = (TDSL.param ~more_label:(config.label)) ?values:None "w" in
+      and w = (TDSL.param ~more_label:(config.label)) ?value:None "w" in
fun x ->
(relu
?label:(Some
File "test/einsum/test_conv_syntax.expected", line 1, characters 0-0:
/usr/sbin/git --no-pager diff --no-index --color=always -u _build/default/test/einsum/test_conv_syntax.expected _build/default/test/einsum/test_conv_syntax.exe.output
diff --git a/_build/default/test/einsum/test_conv_syntax.expected b/_build/default/test/einsum/test_conv_syntax.exe.output
index 4bd5a1c..0580e1e 100644
--- a/_build/default/test/einsum/test_conv_syntax.expected
+++ b/_build/default/test/einsum/test_conv_syntax.exe.output
@@ -1,5 +1,5 @@


-Welcome to OCANNL! Reading configuration defaults from /Users/lukstafi/ocannl/_build/default/test/einsum/ocannl_config.
+Welcome to OCANNL! Reading configuration defaults from /src/_build/default/test/einsum/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
Testing conv syntax parsing...
File "test/test_print_style.expected", line 1, characters 0-0:
/usr/sbin/git --no-pager diff --no-index --color=always -u _build/default/test/test_print_style.expected _build/default/test/test_print_style.exe.output
diff --git a/_build/default/test/test_print_style.expected b/_build/default/test/test_print_style.exe.output
index e51ab37..c55c8ad 100644
--- a/_build/default/test/test_print_style.expected
+++ b/_build/default/test/test_print_style.exe.output
@@ -1,5 +1,5 @@


-Welcome to OCANNL! Reading configuration defaults from /Users/lukstafi/ocannl/_build/default/test/ocannl_config.
+Welcome to OCANNL! Reading configuration defaults from /src/_build/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
Testing print_style functionality:
File "test/dune", lines 30-40, characters 0-281:
30 | (rule
31 |  (alias runtest)
32 |  (target
33 |   (dir log_files))
34 |  (action
35 |   (run
36 |    %{dep:micrograd_demo_logging.exe}
37 |    "--ocannl_debug_backend=text"
38 |    "--ocannl_log_file_stem=micrograd_demo_logging"
39 |    "--ocannl_log_main_domain_to_stdout=false"
40 |    "--ocannl_debug_log_to_stream_files=true")))
(cd _build/default/test && ./micrograd_demo_logging.exe --ocannl_debug_backend=text --ocannl_log_file_stem=micrograd_demo_logging --ocannl_log_main_domain_to_stdout=false --ocannl_debug_log_to_stream_files=true)


Welcome to OCANNL! Reading configuration defaults from /src/_build/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
Retrieving commandline, environment, or config file variable ocannl_backend
Found multicore_cc, in the config file
Fatal error: exception Invalid_argument("Shape.make: do not provide both batch_dims, batch_axes")
Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
Called from Dune__exe__Micrograd_demo_logging in file "test/micrograd_demo_logging.ml", line 22, characters 13-23
File "test_ppx/dune", line 25, characters 7-18:
25 |  (name test_ppx_op)
^^^^^^^^^^^
(cd _build/default/test_ppx && ./test_ppx_op.exe)


Welcome to OCANNL! Reading configuration defaults from /src/_build/default/test_ppx/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
Fatal error: exception Invalid_argument("Shape.make: do not provide both batch_dims, batch_axes")
Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
Called from Dune__exe__Test_ppx_op.y0 in file "test_ppx/test_ppx_op.ml", line 5, characters 18-24
File "test_ppx/dune", line 34, characters 7-27:
34 |  (name test_ppx_op_expected)
^^^^^^^^^^^^^^^^^^^^
(cd _build/default/test_ppx && ./test_ppx_op_expected.exe)


Welcome to OCANNL! Reading configuration defaults from /src/_build/default/test_ppx/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
Fatal error: exception Invalid_argument("Shape.make: do not provide both batch_dims, batch_axes")
Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
Called from Dune__exe__Test_ppx_op_expected.y0 in file "test_ppx/test_ppx_op_expected.ml", line 5, characters 13-43
File "test/einsum/dune", line 5, characters 7-25:
5 |  (name moons_demo_variant)
^^^^^^^^^^^^^^^^^^
(cd _build/default/test/einsum && ./moons_demo_variant.exe) > _build/default/test/einsum/moons_demo_variant.exe.output
Fatal error: exception Invalid_argument("Shape.make: do not provide both batch_dims, batch_axes")
Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
Called from Dune__exe__Moons_demo_variant in file "test/einsum/moons_demo_variant.ml", line 34, characters 62-69
File "test/dune", line 4, characters 7-30:
4 |  (name moons_demo_parallel_run)
^^^^^^^^^^^^^^^^^^^^^^^
(cd _build/default/test && ./moons_demo_parallel_run.exe)


Welcome to OCANNL! Reading configuration defaults from /src/_build/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
("Set log_level to" 1)
└─{orphaned from #27}
Fatal error: exception Invalid_argument("Shape.make: do not provide both batch_dims, batch_axes")
Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
Called from Dune__exe__Moons_demo_parallel_run.main in file "test/moons_demo_parallel_run.ml", line 28, characters 67-79
Called from Base__Exn.protectx in file "src/exn.ml", line 79, characters 8-11
Re-raised at Base__Exn.raise_with_original_backtrace in file "src/exn.ml" (inlined), line 59, characters 2-50
Called from Base__Exn.protectx in file "src/exn.ml", line 86, characters 13-49
Called from Base__Exn.protect in file "src/exn.ml" (inlined), line 92, characters 26-49
Called from Dune__exe__Moons_demo_parallel_run in file "test/moons_demo_parallel_run.ml", line 82, characters 2-53
(cd _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test && .tutorials.inline-tests/inline-test-runner.exe inline-test-runner tutorials -partition '' -source-tree-root .. -diff-cmd -)


Welcome to OCANNL! Reading configuration defaults from /src/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
(cd _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test && .tutorials.inline-tests/inline-test-runner.exe inline-test-runner tutorials -partition 'Welcome to OCANNL! Reading configuration defaults from /src/_build/.sandbox/20731a206c7b03155657805e7cb50303/default/test/ocannl_config.' -source-tree-root .. -diff-cmd -)


Welcome to OCANNL! Reading configuration defaults from /src/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
(cd _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test && .tutorials.inline-tests/inline-test-runner.exe inline-test-runner tutorials -partition 'Retrieving commandline, environment, or config file variable ocannl_log_level' -source-tree-root .. -diff-cmd -)


Welcome to OCANNL! Reading configuration defaults from /src/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
(cd _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test && .tutorials.inline-tests/inline-test-runner.exe inline-test-runner tutorials -partition moons_demo_parallel.ml -source-tree-root .. -diff-cmd -)


Welcome to OCANNL! Reading configuration defaults from /src/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
(cd _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test && .tutorials.inline-tests/inline-test-runner.exe inline-test-runner tutorials -partition 'Found 0, in the config file' -source-tree-root .. -diff-cmd -)


Welcome to OCANNL! Reading configuration defaults from /src/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
(cd _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test && .tutorials.inline-tests/inline-test-runner.exe inline-test-runner tutorials -partition micrograd_demo.ml -source-tree-root .. -diff-cmd -)


Welcome to OCANNL! Reading configuration defaults from /src/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
(cd _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test && .tutorials.inline-tests/inline-test-runner.exe inline-test-runner tutorials -partition zero2hero_1of7.ml -source-tree-root .. -diff-cmd -)


Welcome to OCANNL! Reading configuration defaults from /src/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
(cd _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test && .tutorials.inline-tests/inline-test-runner.exe inline-test-runner tutorials -partition primitive_ops.ml -source-tree-root .. -diff-cmd -)


Welcome to OCANNL! Reading configuration defaults from /src/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
(cd _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test && .tutorials.inline-tests/inline-test-runner.exe inline-test-runner tutorials -partition hello_world_op.ml -source-tree-root .. -diff-cmd -)


Welcome to OCANNL! Reading configuration defaults from /src/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
File "test/einsum/einsum_trivia_exec.expected", line 1, characters 0-0:
/usr/sbin/git --no-pager diff --no-index --color=always -u _build/default/test/einsum/einsum_trivia_exec.expected _build/default/test/einsum/einsum_trivia_exec.exe.output
diff --git a/_build/default/test/einsum/einsum_trivia_exec.expected b/_build/default/test/einsum/einsum_trivia_exec.exe.output
index ab456b5..b3dd655 100644
--- a/_build/default/test/einsum/einsum_trivia_exec.expected
+++ b/_build/default/test/einsum/einsum_trivia_exec.exe.output
@@ -1,5 +1,5 @@


-Welcome to OCANNL! Reading configuration defaults from /Users/lukstafi/ocannl/_build/default/test/einsum/ocannl_config.
+Welcome to OCANNL! Reading configuration defaults from /src/_build/default/test/einsum/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
HERE: test/einsum/einsum_trivia_exec.ml:31:21
@@ -735,173 +735,173 @@ HERE: test/einsum/einsum_trivia_exec.ml:269:21


HERE: test/einsum/einsum_trivia_exec.ml:298:21
-┌────────────────────────────────┐
-│[9]: ;=>+ shape 0:4,1:5,2:6,3:3 │
-│┌──────┬──────────────────┐     │
-││0 @ 0 │axis 3            │     │
-│├──────┼──────────────────┤     │
-││0 @ 1 │ 0.00  0.00  0.00 │     │
-││axis 2│ 0.00  0.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 0.00  0.00  4.00 │     │
-││      │ 0.00  0.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││1 @ 1 │ 0.00  1.00  0.00 │     │
-││axis 2│ 0.00  1.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 0.00  1.00  4.00 │     │
-││      │ 0.00  1.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││2 @ 1 │ 0.00  2.00  0.00 │     │
-││axis 2│ 0.00  2.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 0.00  2.00  4.00 │     │
-││      │ 0.00  2.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││3 @ 1 │ 0.00  3.00  0.00 │     │
-││axis 2│ 0.00  3.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 0.00  3.00  4.00 │     │
-││      │ 0.00  3.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││4 @ 1 │ 0.00  4.00  0.00 │     │
-││axis 2│ 0.00  4.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 0.00  4.00  4.00 │     │
-││      │ 0.00  4.00  5.00 │     │
-│└──────┴──────────────────┘     │
-├────────────────────────────────┤
-│┌──────┬──────────────────┐     │
-││1 @ 0 │axis 3            │     │
-│├──────┼──────────────────┤     │
-││0 @ 1 │ 1.00  0.00  0.00 │     │
-││axis 2│ 1.00  0.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 1.00  0.00  4.00 │     │
-││      │ 1.00  0.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││1 @ 1 │ 1.00  1.00  0.00 │     │
-││axis 2│ 1.00  1.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 1.00  1.00  4.00 │     │
-││      │ 1.00  1.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││2 @ 1 │ 1.00  2.00  0.00 │     │
-││axis 2│ 1.00  2.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 1.00  2.00  4.00 │     │
-││      │ 1.00  2.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││3 @ 1 │ 1.00  3.00  0.00 │     │
-││axis 2│ 1.00  3.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 1.00  3.00  4.00 │     │
-││      │ 1.00  3.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││4 @ 1 │ 1.00  4.00  0.00 │     │
-││axis 2│ 1.00  4.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 1.00  4.00  4.00 │     │
-││      │ 1.00  4.00  5.00 │     │
-│└──────┴──────────────────┘     │
-├────────────────────────────────┤
-│┌──────┬──────────────────┐     │
-││2 @ 0 │axis 3            │     │
-│├──────┼──────────────────┤     │
-││0 @ 1 │ 2.00  0.00  0.00 │     │
-││axis 2│ 2.00  0.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 2.00  0.00  4.00 │     │
-││      │ 2.00  0.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││1 @ 1 │ 2.00  1.00  0.00 │     │
-││axis 2│ 2.00  1.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 2.00  1.00  4.00 │     │
-││      │ 2.00  1.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││2 @ 1 │ 2.00  2.00  0.00 │     │
-││axis 2│ 2.00  2.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 2.00  2.00  4.00 │     │
-││      │ 2.00  2.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││3 @ 1 │ 2.00  3.00  0.00 │     │
-││axis 2│ 2.00  3.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 2.00  3.00  4.00 │     │
-││      │ 2.00  3.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││4 @ 1 │ 2.00  4.00  0.00 │     │
-││axis 2│ 2.00  4.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 2.00  4.00  4.00 │     │
-││      │ 2.00  4.00  5.00 │     │
-│└──────┴──────────────────┘     │
-├────────────────────────────────┤
-│┌──────┬──────────────────┐     │
-││3 @ 0 │axis 3            │     │
-│├──────┼──────────────────┤     │
-││0 @ 1 │ 3.00  0.00  0.00 │     │
-││axis 2│ 3.00  0.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 3.00  0.00  4.00 │     │
-││      │ 3.00  0.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││1 @ 1 │ 3.00  1.00  0.00 │     │
-││axis 2│ 3.00  1.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 3.00  1.00  4.00 │     │
-││      │ 3.00  1.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││2 @ 1 │ 3.00  2.00  0.00 │     │
-││axis 2│ 3.00  2.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 3.00  2.00  4.00 │     │
-││      │ 3.00  2.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││3 @ 1 │ 3.00  3.00  0.00 │     │
-││axis 2│ 3.00  3.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 3.00  3.00  4.00 │     │
-││      │ 3.00  3.00  5.00 │     │
-│├──────┼──────────────────┤     │
-││4 @ 1 │ 3.00  4.00  0.00 │     │
-││axis 2│ 3.00  4.00  1.00 │     │
-││      │ ...   ...   ...  │     │
-││      │ 3.00  4.00  4.00 │     │
-││      │ 3.00  4.00  5.00 │     │
-│└──────┴──────────────────┘     │
-└────────────────────────────────┘
+┌───────────────────────────────────────┐
+│[9]: ;=>+ shape 0:4,1:5,2:6,3:3        │
+│┌──────┬──────────────────────────────┐│
+││0 @ 0 │axis 3                        ││
+│├──────┼──────────────────────────────┤│
+││0 @ 1 │ 1.71e-1   0.00      0.00     ││
+││axis 2│ 1.71e-1   0.00      1.00     ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  4.03e-41  4.00     ││
+││      │ 1.71e-1   -2.08e+6  5.00     ││
+│├──────┼──────────────────────────────┤│
+││1 @ 1 │ 3.56e-40  1.00      0.00     ││
+││axis 2│ 0.00      1.00      1.00     ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  1.00      4.00     ││
+││      │ 0.00      -2.08e+6  5.00     ││
+│├──────┼──────────────────────────────┤│
+││2 @ 1 │ 3.56e-40  2.00      0.00     ││
+││axis 2│ 0.00      2.00      1.00     ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  2.00      4.00     ││
+││      │ 0.00      -2.08e+6  5.00     ││
+│├──────┼──────────────────────────────┤│
+││3 @ 1 │ 3.56e-40  3.00      0.00     ││
+││axis 2│ 0.00      3.00      1.00     ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  3.00      4.00     ││
+││      │ 0.00      -2.08e+6  5.00     ││
+│├──────┼──────────────────────────────┤│
+││4 @ 1 │ -2.88e+5  4.00      2.80e-33 ││
+││axis 2│ -2.88e+5  4.00      1.00     ││
+││      │ ...       ...       ...      ││
+││      │ -2.36e+6  4.00      4.00     ││
+││      │ -2.88e+5  -2.08e+6  5.00     ││
+│└──────┴──────────────────────────────┘│
+├───────────────────────────────────────┤
+│┌──────┬──────────────────────────────┐│
+││1 @ 0 │axis 3                        ││
+│├──────┼──────────────────────────────┤│
+││0 @ 1 │ 1.17      2.89e+32  3.31e+24 ││
+││axis 2│ 1.17      2.89e+32  3.31e+24 ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  2.89e+32  3.31e+24 ││
+││      │ 1.17      2.89e+32  3.31e+24 ││
+│├──────┼──────────────────────────────┤│
+││1 @ 1 │ 1.00      2.89e+32  3.31e+24 ││
+││axis 2│ 1.00      2.89e+32  3.31e+24 ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  2.89e+32  3.31e+24 ││
+││      │ 1.00      2.89e+32  3.31e+24 ││
+│├──────┼──────────────────────────────┤│
+││2 @ 1 │ 1.00      2.89e+32  3.31e+24 ││
+││axis 2│ 1.00      2.89e+32  3.31e+24 ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  2.89e+32  3.31e+24 ││
+││      │ 1.00      2.89e+32  3.31e+24 ││
+│├──────┼──────────────────────────────┤│
+││3 @ 1 │ 1.00      2.89e+32  3.31e+24 ││
+││axis 2│ 1.00      2.89e+32  3.31e+24 ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  2.89e+32  3.31e+24 ││
+││      │ 1.00      2.89e+32  3.31e+24 ││
+│├──────┼──────────────────────────────┤│
+││4 @ 1 │ -2.88e+5  2.89e+32  3.31e+24 ││
+││axis 2│ -2.88e+5  2.89e+32  3.31e+24 ││
+││      │ ...       ...       ...      ││
+││      │ -2.36e+6  2.89e+32  3.31e+24 ││
+││      │ -2.88e+5  2.89e+32  3.31e+24 ││
+│└──────┴──────────────────────────────┘│
+├───────────────────────────────────────┤
+│┌──────┬──────────────────────────────┐│
+││2 @ 0 │axis 3                        ││
+│├──────┼──────────────────────────────┤│
+││0 @ 1 │ 2.17      4.12e-8   6.44e-10 ││
+││axis 2│ 2.17      4.12e-8   1.00     ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  4.12e-8   4.00     ││
+││      │ 2.17      -2.08e+6  5.00     ││
+│├──────┼──────────────────────────────┤│
+││1 @ 1 │ 2.00      1.00      6.44e-10 ││
+││axis 2│ 2.00      1.00      1.00     ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  1.00      4.00     ││
+││      │ 2.00      -2.08e+6  5.00     ││
+│├──────┼──────────────────────────────┤│
+││2 @ 1 │ 2.00      2.00      6.44e-10 ││
+││axis 2│ 2.00      2.00      1.00     ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  2.00      4.00     ││
+││      │ 2.00      -2.08e+6  5.00     ││
+│├──────┼──────────────────────────────┤│
+││3 @ 1 │ 2.00      3.00      6.44e-10 ││
+││axis 2│ 2.00      3.00      1.00     ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  3.00      4.00     ││
+││      │ 2.00      -2.08e+6  5.00     ││
+│├──────┼──────────────────────────────┤│
+││4 @ 1 │ -2.88e+5  4.00      6.44e-10 ││
+││axis 2│ -2.88e+5  4.00      1.00     ││
+││      │ ...       ...       ...      ││
+││      │ -2.36e+6  4.00      4.00     ││
+││      │ -2.88e+5  -2.08e+6  5.00     ││
+│└──────┴──────────────────────────────┘│
+├───────────────────────────────────────┤
+│┌──────┬──────────────────────────────┐│
+││3 @ 0 │axis 3                        ││
+│├──────┼──────────────────────────────┤│
+││0 @ 1 │ 3.17      1.64e+19  1.38e+31 ││
+││axis 2│ 3.17      1.64e+19  1.38e+31 ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  1.64e+19  1.38e+31 ││
+││      │ 3.17      1.64e+19  1.38e+31 ││
+│├──────┼──────────────────────────────┤│
+││1 @ 1 │ 3.00      1.64e+19  1.38e+31 ││
+││axis 2│ 3.00      1.64e+19  1.38e+31 ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  1.64e+19  1.38e+31 ││
+││      │ 3.00      1.64e+19  1.38e+31 ││
+│├──────┼──────────────────────────────┤│
+││2 @ 1 │ 3.00      1.64e+19  1.38e+31 ││
+││axis 2│ 3.00      1.64e+19  1.38e+31 ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  1.64e+19  1.38e+31 ││
+││      │ 3.00      1.64e+19  1.38e+31 ││
+│├──────┼──────────────────────────────┤│
+││3 @ 1 │ 3.00      1.64e+19  1.38e+31 ││
+││axis 2│ 3.00      1.64e+19  1.38e+31 ││
+││      │ ...       ...       ...      ││
+││      │ -2.08e+6  1.64e+19  1.38e+31 ││
+││      │ 3.00      1.64e+19  1.38e+31 ││
+│├──────┼──────────────────────────────┤│
+││4 @ 1 │ -2.88e+5  1.64e+19  1.38e+31 ││
+││axis 2│ -2.88e+5  1.64e+19  1.38e+31 ││
+││      │ ...       ...       ...      ││
+││      │ -2.36e+6  1.64e+19  1.38e+31 ││
+││      │ -2.88e+5  1.64e+19  1.38e+31 ││
+│└──────┴──────────────────────────────┘│
+└───────────────────────────────────────┘


HERE: test/einsum/einsum_trivia_exec.ml:299:21
-┌───────────────────────────┐
-│[1]: =>_ti shape 0:4,1:3   │
-│┌──────┬──────────────────┐│
-││      │axis 1            ││
-│├──────┼──────────────────┤│
-││axis 0│ 0.00  0.00  0.00 ││
-││      │ 1.00  0.00  0.00 ││
-││      │ 2.00  0.00  0.00 ││
-││      │ 3.00  0.00  0.00 ││
-│└──────┴──────────────────┘│
-└───────────────────────────┘
+┌───────────────────────────────────┐
+│[1]: =>_ti shape 0:4,1:3           │
+│┌──────┬──────────────────────────┐│
+││      │axis 1                    ││
+│├──────┼──────────────────────────┤│
+││axis 0│ 0.00  0.00      0.00     ││
+││      │ 1.00  2.89e+32  3.31e+24 ││
+││      │ 2.00  4.12e-8   6.44e-10 ││
+││      │ 3.00  1.64e+19  1.38e+31 ││
+│└──────┴──────────────────────────┘│
+└───────────────────────────────────┘


HERE: test/einsum/einsum_trivia_exec.ml:300:21
-┌───────────────────────────┐
-│[7]: =>_tk shape 0:6,1:3   │
-│┌──────┬──────────────────┐│
-││      │axis 1            ││
-│├──────┼──────────────────┤│
-││axis 0│ 0.00  0.00  0.00 ││
-││      │ 0.00  0.00  1.00 ││
-││      │ ...   ...   ...  ││
-││      │ 0.00  0.00  4.00 ││
-││      │ 0.00  0.00  5.00 ││
-│└──────┴──────────────────┘│
-└───────────────────────────┘
+┌───────────────────────────────────┐
+│[7]: =>_tk shape 0:6,1:3           │
+│┌──────┬──────────────────────────┐│
+││      │axis 1                    ││
+│├──────┼──────────────────────────┤│
+││axis 0│ 3.56e-40  0.00      0.00 ││
+││      │ 0.00      0.00      1.00 ││
+││      │ ...       ...       ...  ││
+││      │ -2.08e+6  4.03e-41  4.00 ││
+││      │ 0.00      -2.08e+6  5.00 ││
+│└──────┴──────────────────────────┘│
+└───────────────────────────────────┘


HERE: test/einsum/einsum_trivia_exec.ml:323:21
(cd _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test && .tutorials.inline-tests/inline-test-runner.exe inline-test-runner tutorials -partition einsum_trivia.ml -source-tree-root .. -diff-cmd -)


Welcome to OCANNL! Reading configuration defaults from /src/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/ocannl_config.
Retrieving commandline, environment, or config file variable ocannl_log_level
Found 0, in the config file
File "test/zero2hero_1of7.ml", line 1, characters 0-0:
/usr/sbin/git --no-pager diff --no-index --color=always -u _build/default/test/zero2hero_1of7.ml _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/zero2hero_1of7.ml.corrected
diff --git a/_build/default/test/zero2hero_1of7.ml b/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/zero2hero_1of7.ml.corrected
index 3b7cc00..f285e44 100644
--- a/_build/default/test/zero2hero_1of7.ml
+++ b/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/zero2hero_1of7.ml.corrected
@@ -28,54 +28,14 @@ let%expect_test "Graph drawing recompile" =
Train.set_hosted x.value;
Train.forward_and_forget backend ctx f_nd;
Tensor.print_tree ~with_grad:true ~depth:9 f_nd;
-  [%expect
-    {|
-                                 #15 +_f_nd
-                                  6.00e+1
-                                 #16 grad_+_f_nd Virt/30
-                                 <void>
-                            #13 - Virt/152                             │#2 5. Virt/40
-                            <void>                                     │<void>
-                            #14 grad_- Virt/30                         │
-                            <void>                                     │
-           #11 *. Virt/152            │       #4 *. Virt/152           │
-           <void>                     │       <void>                   │
-           #12 grad_*. Virt/30        │       #5 grad_*. Virt/30       │
-           <void>                     │       <void>                   │
-    #10 3. Virt/40│#7 **. Virt/152    │#3 4. Virt/40│#0 x              │
-    <void>        │<void>             │<void>       │ 5.00             │
-                  │#8 grad_**. Virt/30│             │#1 grad_x Local/30│
-                  │<void>             │             │<void>            │
-                  │[0]│ #6 2. Virt/40 │             │                  │
-                  │   │ <void>        │             │                  │
-    |}];
+  [%expect.unreachable];
let%op f = (3 *. ("x" [ 5 ] **. 2)) - (4 *. x) + 5 in
Train.every_non_literal_on_host f;
let f_upd = Train.grad_update f in
let f_bprop = Train.to_routine (module Backend) ctx IDX.empty f_upd in
Train.run f_bprop;
Tensor.print_tree ~with_grad:true ~depth:9 f;
-  [%expect
-    {|
-                                   #32 +_f
-                                    6.00e+1
-                                   #33 grad_+_f
-                                    1.00
-                             #30 -                              │#19 5. Virt/40
-                              5.50e+1                           │<void>
-                             #31 grad_-                         │
-                              1.00                              │
-               #28 *.                 │       #21 *.            │
-                7.50e+1               │        2.00e+1          │
-               #29 grad_*.            │       #22 grad_*.       │
-                1.00                  │        -1.00            │
-    #27 3. Virt/40│   #24 **.         │#20 4. Virt/40│#17 x     │
-    <void>        │    2.50e+1        │<void>        │ 5.00     │
-                  │   #25 grad_**.    │              │#18 grad_x│
-                  │    3.00           │              │ 2.60e+1  │
-                  │[17]│#23 2. Virt/40│              │          │
-                  │    │<void>        │              │          │
-    |}];
+  [%expect.unreachable];
let xs = Array.init 10 ~f:Float.(fun i -> of_int i - 5.) in
let ys =
Array.map xs ~f:(fun v ->
@@ -94,54 +54,19 @@ let%expect_test "Graph drawing recompile" =
[ Scatterplot { points = Array.zip_exn xs ys; content = PrintBox.line "#" } ]
in
PrintBox_text.output Stdio.stdout plot_box;
-  [%expect
-    {|
-    ┌────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │ 1.00e+2│#                                                                                                   │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │           #                                                                                        │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │f       │                                                                                                    │
-    │(       │                                                                                                    │
-    │x       │                                                                                                    │
-    │)       │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                      #                                                                             │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                   #│
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                 #                                                                  │
-    │        │                                                                                                    │
-    │        │                                                                                        #           │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                            #                                                       │
-    │        │                                                                             #                      │
-    │        │                                                                                                    │
-    │ 4.00   │                                                       #          #                                 │
-    ├────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
-    │        │-5.00                                                                                           4.00│
-    │        │                                                 x                                                  │
-    └────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
-    |}]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Zero2hero_1of7.(fun) in file "test/zero2hero_1of7.ml", line 27, characters 23-32
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]


let%expect_test "Graph drawing fetch" =
Tensor.unsafe_reinitialize ();
@@ -271,96 +196,36 @@ let%expect_test "Simple gradients hosted" =
let sgd_routine = Train.to_routine (module Backend) grad_routine.context IDX.empty sgd in
(* Check out the initial state without running a forward pass. *)
Tensor.print_tree ~spy:true ~with_grad:true ~depth:9 l;
-  [%expect
-    {|
-                                        #12 *._l Host&stream/41
-                                        <not-in-yet>
-                                        #13 grad_*._l Host&stream/41
-                                        <not-in-yet>
-                            #8 +_d Host&stream/41                             │#10 f Host&shared/39
-                            <not-in-yet>                                      │<not-in-yet>
-                            #9 grad_+_d Host&stream/41                        │#11 grad_f Host&stream/41
-                            <not-in-yet>                                      │<not-in-yet>
-               #4 *._e Host&stream/41                │#6 c Host&shared/39     │
-               <not-in-yet>                          │<not-in-yet>            │
-               #5 grad_*._e Host&stream/41           │#7 grad_c Host&stream/41│
-               <not-in-yet>                          │<not-in-yet>            │
-    #0 a Host&shared/39     │#2 b Host&shared/39     │                        │
-    <not-in-yet>            │<not-in-yet>            │                        │
-    #1 grad_a Host&stream/41│#3 grad_b Host&stream/41│                        │
-    <not-in-yet>            │<not-in-yet>            │                        │
-    |}];
+  [%expect.unreachable];
(* Do not update the params: all values and gradients will be at initial points, which are
specified in the tensor in the brackets. *)
Train.run grad_routine;
Tensor.print_tree ~with_grad:true ~depth:9 l;
-  [%expect
-    {|
-                 #12 *._l
-                  -8.00
-                 #13 grad_*._l
-                  1.00
-             #8 +_d              │#10 f
-              4.00               │ -2.00
-             #9 grad_+_d         │#11 grad_f
-              -2.00              │ 4.00
-       #4 *._e         │#6 c     │
-        -6.00          │ 1.00e+1 │
-       #5 grad_*._e    │#7 grad_c│
-        -2.00          │ -2.00   │
-    #0 a     │#2 b     │         │
-     2.00    │ -3.00   │         │
-    #1 grad_a│#3 grad_b│         │
-     6.00    │ -4.00   │         │
-    |}];
+  [%expect.unreachable];
(* Now we update the params, but we are not doing the forward and backward passes: only params
values will change, compared to the above. The update is in the opposite direction of the
gradient. *)
Train.run sgd_routine;
Tensor.print_tree ~with_grad:true ~depth:9 l;
-  [%expect
-    {|
-                 #12 *._l
-                  -8.00
-                 #13 grad_*._l
-                  1.00
-             #8 +_d              │#10 f
-              4.00               │ -2.40
-             #9 grad_+_d         │#11 grad_f
-              -2.00              │ 4.00
-       #4 *._e         │#6 c     │
-        -6.00          │ 1.02e+1 │
-       #5 grad_*._e    │#7 grad_c│
-        -2.00          │ -2.00   │
-    #0 a     │#2 b     │         │
-     1.40    │ -2.60   │         │
-    #1 grad_a│#3 grad_b│         │
-     6.00    │ -4.00   │         │
-    |}];
+  [%expect.unreachable];


(* Now the params will remain as above, but both param gradients and the values and gradients of
other nodes will change thanks to the forward and backward passes. *)
Train.run grad_routine;
Tensor.print_tree ~with_grad:true ~depth:9 l;
-  [%expect
-    {|
-                 #12 *._l
-                  -1.57e+1
-                 #13 grad_*._l
-                  1.00
-             #8 +_d              │#10 f
-              6.56               │ -2.40
-             #9 grad_+_d         │#11 grad_f
-              -2.40              │ 6.56
-       #4 *._e         │#6 c     │
-        -3.64          │ 1.02e+1 │
-       #5 grad_*._e    │#7 grad_c│
-        -2.40          │ -2.40   │
-    #0 a     │#2 b     │         │
-     1.40    │ -2.60   │         │
-    #1 grad_a│#3 grad_b│         │
-     6.24    │ -3.36   │         │
-    |}]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Zero2hero_1of7.(fun) in file "test/zero2hero_1of7.ml", line 260, characters 13-22
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]


let%expect_test "Simple gradients virtual" =
Tensor.unsafe_reinitialize ();
@@ -379,70 +244,16 @@ let%expect_test "Simple gradients virtual" =
let sgd = Train.sgd_update ~learning_rate l in
(* Check out the initial state without forcing memory modes by compilation. *)
Tensor.print_tree ~spy:true ~with_grad:true ~depth:9 l;
-  [%expect
-    {|
-                                       #12 *._l Host&dev/41
-                                       <not-in-yet>
-                                       #13 grad_*._l unknown
-                                       <not-in-yet>
-                            #8 +_d unknown                              │#10 f Host-non-const/24
-                            <not-in-yet>                                │<not-in-yet>
-                            #9 grad_+_d unknown                         │#11 grad_f Material/28
-                            <not-in-yet>                                │<not-in-yet>
-                #4 *._e unknown                  │#6 c Host-non-const/24│
-                <not-in-yet>                     │<not-in-yet>          │
-                #5 grad_*._e unknown             │#7 grad_c Material/28 │
-                <not-in-yet>                     │<not-in-yet>          │[0m
-    #0 a Host-non-const/24│#2 b Host-non-const/24│                      │
-    <not-in-yet>          │<not-in-yet>          │                      │
-    #1 grad_a Material/28 │#3 grad_b Material/28 │                      │
-    <not-in-yet>          │<not-in-yet>          │                      │
-    |}];
+  [%expect.unreachable];
let grad_routine = Train.to_routine (module Backend) ctx IDX.empty grad in
(* Check out the state without running a forward pass or compiling the SGD update. *)
Tensor.print_tree ~spy:true ~with_grad:true ~depth:9 l;
-  [%expect
-    {|
-                                        #12 *._l Host&stream/41
-                                        <not-in-yet>
-                                        #13 grad_*._l Virt/40
-                                        <not-in-yet>
-                              #8 +_d Local/46                              │#10 f Host&shared/39
-                              <not-in-yet>                                 │<not-in-yet>
-                              #9 grad_+_d Virt/40                          │#11 grad_f Dev-stream/41
-                              <not-in-yet>                                 │<not-in-yet>
-                 #4 *._e Virt/152                  │#6 c Host&shared/39    │
-                 <not-in-yet>                      │<not-in-yet>           │
-                 #5 grad_*._e Virt/40              │#7 grad_c Dev-stream/41│
-                 <not-in-yet>                      │<not-in-yet>           │
-    #0 a Host&shared/39    │#2 b Host&shared/39    │                       │
-    <not-in-yet>           │<not-in-yet>           │                       │
-    #1 grad_a Dev-stream/41│#3 grad_b Dev-stream/41│                       │
-    <not-in-yet>           │<not-in-yet>           │                       │
-    |}];
+  [%expect.unreachable];
(* Do not update the params: all values and gradients will be at initial points, which are
specified in the tensor in the brackets. *)
Train.run grad_routine;
Tensor.print_tree ~with_grad:true ~depth:9 l;
-  [%expect
-    {|
-                                         #12 *._l
-                                          -8.00
-                                         #13 grad_*._l Virt/40
-                                         <void>
-                              #8 +_d Local/46                              │#10 f
-                              <void>                                       │ -2.00
-                              #9 grad_+_d Virt/40                          │#11 grad_f Dev-stream/41
-                              <void>                                       │<void>
-                 #4 *._e Virt/152                  │#6 c                   │
-                 <void>                            │ 1.00e+1               │
-                 #5 grad_*._e Virt/40              │#7 grad_c Dev-stream/41│
-                 <void>                            │<void>                 │
-    #0 a                   │#2 b                   │                       │
-     2.00                  │ -3.00                 │                       │
-    #1 grad_a Dev-stream/41│#3 grad_b Dev-stream/41│                       │
-    <void>                 │<void>                 │                       │
-    |}];
+  [%expect.unreachable];
(* Only now compile the SGD update. *)
let sgd_routine = Train.to_routine (module Backend) grad_routine.context IDX.empty sgd in
(* Now we update the params, but are not doing the forward and backward passes: only params values
@@ -450,48 +261,24 @@ let%expect_test "Simple gradients virtual" =
always be recomputed using the latest parameter state. *)
Train.run sgd_routine;
Tensor.print_tree ~with_grad:true ~depth:9 l;
-  [%expect
-    {|
-                                         #12 *._l
-                                          -8.00
-                                         #13 grad_*._l Virt/40
-                                         <void>
-                              #8 +_d Local/46                              │#10 f
-                              <void>                                       │ -2.40
-                              #9 grad_+_d Virt/40                          │#11 grad_f Dev-stream/41
-                              <void>                                       │<void>
-                 #4 *._e Virt/152                  │#6 c                   │
-                 <void>                            │ 1.02e+1               │
-                 #5 grad_*._e Virt/40              │#7 grad_c Dev-stream/41│
-                 <void>                            │<void>                 │
-    #0 a                   │#2 b                   │                       │
-     1.40                  │ -2.60                 │                       │
-    #1 grad_a Dev-stream/41│#3 grad_b Dev-stream/41│                       │
-    <void>                 │<void>                 │                       │
-    |}];
+  [%expect.unreachable];
(* Now the params will remain as above, but both param gradients and the values and gradients of
other nodes will change thanks to the forward and backward passes. *)
Train.run grad_routine;
Tensor.print_tree ~with_grad:true ~depth:9 l;
-  [%expect
-    {|
-                                         #12 *._l
-                                          -1.57e+1
-                                         #13 grad_*._l Virt/40
-                                         <void>
-                              #8 +_d Local/46                              │#10 f
-                              <void>                                       │ -2.40
-                              #9 grad_+_d Virt/40                          │#11 grad_f Dev-stream/41
-                              <void>                                       │<void>
-                 #4 *._e Virt/152                  │#6 c                   │
-                 <void>                            │ 1.02e+1               │
-                 #5 grad_*._e Virt/40              │#7 grad_c Dev-stream/41│
-                 <void>                            │<void>                 │
-    #0 a                   │#2 b                   │                       │
-     1.40                  │ -2.60                 │                       │
-    #1 grad_a Dev-stream/41│#3 grad_b Dev-stream/41│                       │
-    <void>                 │<void>                 │                       │
-    |}]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Zero2hero_1of7.(fun) in file "test/zero2hero_1of7.ml", line 371, characters 13-22
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]


let%expect_test "tanh plot" =
Tensor.unsafe_reinitialize ();
@@ -510,21 +297,19 @@ let%expect_test "2D neuron hosted" =
let routine = Train.to_routine (module Backend) ctx IDX.empty update in
Train.run routine;
Tensor.print_tree ~with_grad:true ~depth:9 v;
-  [%expect
-    {|
-                 #8 +_v
-                  7.00e-1
-                 #9 grad_+_v
-                  1.00
-             #6 *              │#0 b
-              -6.00            │ 6.70
-             #7 grad_*         │#1 grad_b
-              1.00             │ 1.00
-    #2 w         │#4 x         │
-     -3.00  1.00 │ 2.00  0.00  │
-    #3 grad_w    │#5 grad_x    │
-     2.00  0.00  │ -3.00  1.00 │
-    |}]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Zero2hero_1of7.(fun) in file "test/zero2hero_1of7.ml", line 507, characters 48-59
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]


let%expect_test "2D neuron virtual" =
Tensor.unsafe_reinitialize ();
@@ -537,18 +322,16 @@ let%expect_test "2D neuron virtual" =
let routine = Train.to_routine (module Backend) ctx IDX.empty update in
Train.run routine;
Tensor.print_tree ~with_grad:true ~depth:9 v;
-  [%expect
-    {|
-                      #8 +_v
-                       7.00e-1
-                      #9 grad_+_v Virt/40
-                      <void>
-              #6 * Local/46              │#0 b
-              <void>                     │ 6.70
-              #7 grad_* Virt/40          │#1 grad_b Local/46
-              <void>                     │<void>
-    #2 w              │#4 x              │
-     -3.00  1.00      │ 2.00  0.00       │
-    #3 grad_w Local/46│#5 grad_x Local/46│
-    <void>            │<void>            │
-    |}]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Zero2hero_1of7.(fun) in file "test/zero2hero_1of7.ml", line 535, characters 48-59
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]
File "test/moons_demo_parallel.ml", line 1, characters 0-0:
/usr/sbin/git --no-pager diff --no-index --color=always -u _build/default/test/moons_demo_parallel.ml _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/moons_demo_parallel.ml.corrected
diff --git a/_build/default/test/moons_demo_parallel.ml b/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/moons_demo_parallel.ml.corrected
index e0e4f52..ed12d69 100644
--- a/_build/default/test/moons_demo_parallel.ml
+++ b/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/moons_demo_parallel.ml.corrected
@@ -97,4 +97,16 @@ let%expect_test "Half-moons data parallel" =
]
in
PrintBox_text.output Stdio.stdout plot_loss);
-  [%expect "Success"]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Moons_demo_parallel.(fun) in file "test/moons_demo_parallel.ml", line 29, characters 67-79
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]
File "test/micrograd_demo.ml", line 1, characters 0-0:
/usr/sbin/git --no-pager diff --no-index --color=always -u _build/default/test/micrograd_demo.ml _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/micrograd_demo.ml.corrected
diff --git a/_build/default/test/micrograd_demo.ml b/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/micrograd_demo.ml.corrected
index b394efe..f080344 100644
--- a/_build/default/test/micrograd_demo.ml
+++ b/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/micrograd_demo.ml.corrected
@@ -31,57 +31,23 @@ let%expect_test "Micrograd README basic example" =
let step = Train.to_routine (module Backend) ctx IDX.empty update in
Train.run step;
Tensor.print ~with_code:false ~with_grad:false `Default g;
-  [%expect
-    {|
-    ┌────────────────────┐
-    │[75]: +_g shape 0:1 │
-    │┌┬─────────┐        │
-    │││axis 0   │        │
-    │├┼─────────┤        │
-    │││ 2.47e+1 │        │
-    │└┴─────────┘        │
-    └────────────────────┘
-    |}];
+  [%expect.unreachable];
Tensor.print ~with_code:false ~with_grad:true `Default a;
-  [%expect
-    {|
-    ┌─────────────────┐
-    │[0]: a shape 0:1 │
-    │┌┬───────┐       │
-    │││axis 0 │       │
-    │├┼───────┤       │
-    │││ -4.00 │       │
-    │└┴───────┘       │
-    └─────────────────┘
-    ┌────────────────────────┐
-    │[0]: a shape 0:1  grad_a│
-    │┌┬─────────┐            │
-    │││axis 0   │            │
-    │├┼─────────┤            │
-    │││ 1.38e+2 │            │
-    │└┴─────────┘            │
-    └────────────────────────┘
-    |}];
+  [%expect.unreachable];
Tensor.print ~with_code:false ~with_grad:true `Default b;
-  [%expect
-    {|
-    ┌─────────────────┐
-    │[2]: b shape 0:1 │
-    │┌┬──────┐        │
-    │││axis 0│        │
-    │├┼──────┤        │
-    │││ 2.00 │        │
-    │└┴──────┘        │
-    └─────────────────┘
-    ┌────────────────────────┐
-    │[2]: b shape 0:1  grad_b│
-    │┌┬─────────┐            │
-    │││axis 0   │            │
-    │├┼─────────┤            │
-    │││ 6.45e+2 │            │
-    │└┴─────────┘            │
-    └────────────────────────┘
-    |}]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Micrograd_demo.(fun) in file "test/micrograd_demo.ml", line 19, characters 13-23
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]


let%expect_test "Micrograd half-moons example" =
Tensor.unsafe_reinitialize ();
@@ -168,223 +134,34 @@ let%expect_test "Micrograd half-moons example" =
in
Stdio.printf "Half-moons scatterplot and decision boundary:\n%!";
PrintBox_text.output Stdio.stdout plot_moons;
-  [%expect
-    {|
-    Half-moons scatterplot and decision boundary:
-    ┌────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │****************************#***********************************************************************│
-    │****************************###***###***#***********************************************************│
-    │***************************#********#***#***********************************************************│
-    │********************#*********************##*#*#****************************************************│
-    │******************#***#*****##*#*#*#****#*#*#*##****************************************************│
-    │**************#*#**###**#*##**##********#**#****###**#**********************************************│
-    │***********#***##***#**##*****************#*#*##*###**********************************************..│
-    │***************#**###******************************##*#******************************************...│
-    │*************#*****#******************************#*#***#*#*************************************....│
-    │*********#***#******************......************##*###**#************************************.....│
-    │******#***#*#*#****************........******************#*#*********************************.......│
-    │*****###****#****************...........****************#***********************************........│
-    │*******#*###****************.............******************#*#*****************************.........│
-    │**********##***************.......%%......***************#**##****************************..........│
-    │*****#***#****************......%..%%......*********************************************..........%.│
-    │**####*******************......%..%..........****************##*#**********************........%...%│
-    │****#*******************.......%%..%..........***************#*#**********************.........%....│
-    │*#****##***************.........%....%.........************##***#********************.......%...%%..│
-    │****#*#***************.........%..%.%...........*************#**#*******************..........%.%...│
-    │##*##****************............%...............**************#*##****************.........%.%.%%%.│
-    │**#####************............%...%%.............*******************************...........%..%.%..│
-    │******************...............%.%.%%............*********#*#*#*#*************................%%..│
-    │***##************................%..%..%............************#*#************.............%...%...│
-    │##**#***********...................%...%.............********#**###***********...........%.%%.......│
-    │###************..................%.%.%................***********##**********..................%....│
-    │**##**********.........................................**********#*********.............%%.%..%.....│
-    │**#**********......................%%...................********##********..............%%.%........│
-    │************..........................%..................****#**#********...................%.......│
-    │***********.........................%%.%..................*****##******...............%..%..........│
-    │**********.............................%%..................***********.................%%.%%........│
-    │*********..............................%...%................*******.....................%%%.........│
-    │********...................................%..%....................................%.....%..........│
-    │*******.................................%%..%.%................................%.%.%.%%.............│
-    │******.....................................%%.%...%%.%.......................%%%....%.%.%...........│
-    │*****....................................%.....%.%..%....................%.....%%.%.%...............│
-    │****........................................%%...%.%%%%..%.......%.........%%.%%....................│
-    │***...............................................%..%.......%..%%%%...%.%..%.%.....................│
-    │**.................................................%.%.%............%..%...%........................│
-    │*.................................................%....%.%......%%...%.%............................│
-    │..........................................................%..%......%%%.............................│
-    └────────────────────────────────────────────────────────────────────────────────────────────────────┘
-    |}];
+  [%expect.unreachable];
Stdio.printf "Loss:\n%!";
let plot_loss =
PrintBox_utils.plot ~x_label:"step" ~y_label:"loss"
[ Line_plot { points = Array.of_list_rev !losses; content = PrintBox.line "-" } ]
in
PrintBox_text.output Stdio.stdout plot_loss;
-  [%expect
-    {|
-    Loss:
-    ┌────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │ 3.79e+1│-                                                                                                   │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │l       │                                                                                                    │
-    │o       │                                                                                                    │
-    │s       │                                                                                                    │
-    │s       │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │-                                                                                                   │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │                                                                                                    │
-    │        │-       -         -                                                                                 │
-    │ 0.00   │----------------------------------------------------------------------------------------------------│
-    ├────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
-    │        │0.00                                                                                         3.99e+2│
-    │        │                                                step                                                │
-    └────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
-    |}];
+  [%expect.unreachable];
Stdio.printf "Log-loss, for better visibility:\n%!";
let plot_loss =
PrintBox_utils.plot ~x_label:"step" ~y_label:"log loss"
[ Line_plot { points = Array.of_list_rev !log_losses; content = PrintBox.line "-" } ]
in
PrintBox_text.output Stdio.stdout plot_loss;
-  [%expect
-    {|
-    Log-loss, for better visibility:
-    ┌─────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │ 3.63    │-                                                                                                   │
-    │         │                                                                                                    │
-    │         │                                                                                                    │
-    │         │                                                                                                    │
-    │         │-                                                                                                   │
-    │         │                                                                                                    │
-    │         │                                                                                                    │
-    │         │                                                                                                    │
-    │         │                                                                                                    │
-    │         │-                                                                                                   │
-    │         │        -         -                                                                                 │
-    │         │ -  -                        -                                                                      │
-    │         │------       -                                                                                      │
-    │         │ ---- -  - --- -   - - -    -                                                                       │
-    │         │   --  -  - - ---     --  -  --            -                                                        │
-    │         │  -  -- - -    ---  - - ---  -----       - --                                                       │
-    │l        │       --  -      - -      -     ---  -    -         -                                              │
-    │o        │       - -  -   --            -  --  - -  -     -                        -                          │
-    │g        │               -     -   -      -  --     - -    -  -     -                   -          -          │
-    │         │     - -     -   --      -                  -      -  --       - -         -                        │
-    │l        │            -             -            --    --            -  -         -  -                       -│
-    │o        │        -        -                           -       -  -       -   -           - -          -    - │
-    │s        │                               -     -        -      -                             --   -           │
-    │s        │                      -                                                   -                         │
-    │         │                       -   -                          -    -           -        -       -    -    - │
-    │         │                   -               - -  -                               -                           │
-    │         │                                                                             -   -                  │
-    │         │                                                  -    -              -                             │
-    │         │                                      -                                        -                    │
-    │         │                                                                                                    │
-    │         │                            -                                                                       │
-    │         │                                                                -                                   │
-    │         │                                                                                                    │
-    │         │                                                                                                    │
-    │         │                                                                                                    │
-    │         │                                                                                                    │
-    │         │          -                                                                                         │
-    │         │                                                                                                    │
-    │         │                                                                                                    │
-    │ -1.00e+1│     -   - -  -   ----- -- --------------- ---------------------------------------------------------│
-    ├─────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
-    │         │0.00                                                                                         3.99e+2│
-    │         │                                                step                                                │
-    └─────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
-    |}];
+  [%expect.unreachable];
Stdio.printf "\nLearning rate:\n%!";
let plot_lr =
PrintBox_utils.plot ~x_label:"step" ~y_label:"learning rate"
[ Line_plot { points = Array.of_list_rev !learning_rates; content = PrintBox.line "-" } ]
in
PrintBox_text.output Stdio.stdout plot_lr;
-  [%expect
-    {|
-    Learning rate:
-    ┌─────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │ -1.00e-1│                                                                                                   -│
-    │         │                                                                                                 ---│
-    │         │                                                                                              ----  │
-    │         │                                                                                            ---     │
-    │         │                                                                                         ----       │
-    │         │                                                                                       ---          │
-    │         │                                                                                    ---             │
-    │         │                                                                                  ---               │
-    │         │                                                                               ---                  │
-    │         │                                                                            ----                    │
-    │         │                                                                          ---                       │
-    │         │                                                                       ----                         │
-    │         │                                                                     ---                            │
-    │l        │                                                                  ----                              │
-    │e        │                                                                ---                                 │
-    │a        │                                                             ---                                    │
-    │r        │                                                           ---                                      │
-    │n        │                                                        ---                                         │
-    │i        │                                                     ----                                           │
-    │n        │                                                   ---                                              │
-    │g        │                                                ----                                                │
-    │         │                                              ---                                                   │
-    │r        │                                           ----                                                     │
-    │a        │                                         ---                                                        │
-    │t        │                                      ---                                                           │
-    │e        │                                    ---                                                             │
-    │         │                                 ---                                                                │
-    │         │                              ----                                                                  │
-    │         │                            ---                                                                     │
-    │         │                         ----                                                                       │
-    │         │                       ---                                                                          │
-    │         │                    ----                                                                            │
-    │         │                  ---                                                                               │
-    │         │               ---                                                                                  │
-    │         │             ---                                                                                    │
-    │         │          ---                                                                                       │
-    │         │       ----                                                                                         │
-    │         │     ---                                                                                            │
-    │         │  ----                                                                                              │
-    │ -2.00e-1│---                                                                                                 │
-    ├─────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
-    │         │0.00                                                                                         3.99e+2│
-    │         │                                                step                                                │
-    └─────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
-    |}];
+  [%expect.unreachable];


(* Testing how the syntax extension %op creates labels for the resulting tensors: *)
Stdio.printf "mlp_result's name: %s\n%!" @@ Tensor.debug_name mlp_result;
(* Note: mlp_result is not included in the resulting tensor's label, because the identifier label
does not propagate across function calls. *)
-  [%expect {| mlp_result's name: mlp_point |}];
+  [%expect.unreachable];
(Stdio.printf "(mlp moons_input) name: %s\n%!"
@@ Tensor.debug_name
@@
@@ -398,4 +175,16 @@ let%expect_test "Micrograd half-moons example" =
] ->
subtensor
| _ -> assert false);
-  [%expect {| (mlp moons_input) name: mlp_moons_input |}]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Micrograd_demo.(fun) in file "test/micrograd_demo.ml", line 108, characters 62-69
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]
File "test/hello_world_op.ml", line 1, characters 0-0:
/usr/sbin/git --no-pager diff --no-index --color=always -u _build/default/test/hello_world_op.ml _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/hello_world_op.ml.corrected
diff --git a/_build/default/test/hello_world_op.ml b/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/hello_world_op.ml.corrected
index 6407bb4..0693fce 100644
--- a/_build/default/test/hello_world_op.ml
+++ b/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/hello_world_op.ml.corrected
@@ -32,17 +32,19 @@ let%expect_test "Pointwise multiplication dims 1" =
Train.forward_and_forget backend ctx y;


Tensor.print ~with_code:false ~with_grad:false `Default @@ y;
-  [%expect
-    {|
-    ┌────────────────────┐
-    │[3]: *._y shape 0:1 │
-    │┌┬─────────┐        │
-    │││axis 0   │        │
-    │├┼─────────┤        │
-    │││ 1.40e+1 │        │
-    │└┴─────────┘        │
-    └────────────────────┘
-    |}]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Hello_world_op.(fun) in file "test/hello_world_op.ml", line 31, characters 18-27
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]


let%expect_test "Matrix multiplication dims 1x1" =
Tensor.unsafe_reinitialize ();
@@ -63,29 +65,21 @@ let%expect_test "Matrix multiplication dims 1x1" =
Train.forward_and_forget backend ctx y;
(* Punning for ["hey"] above introduced the [hey] identifier. *)
Tensor.print ~with_code:false ~with_grad:false `Default @@ hey;
-  [%expect
-    {|
-    ┌────────────────────────┐
-    │[0]: hey shape 1:1->0:1 │
-    │┌──────┬──────┐         │
-    ││      │axis 1│         │
-    │├──────┼──────┤         │
-    ││axis 0│ 7.00 │         │
-    │└──────┴──────┘         │
-    └────────────────────────┘
-    |}];
+  [%expect.unreachable];
Tensor.print ~with_code:false ~with_grad:false `Default @@ y;
-  [%expect
-    {|
-    ┌───────────────────┐
-    │[6]: +_y shape 0:1 │
-    │┌┬─────────┐       │
-    │││axis 0   │       │
-    │├┼─────────┤       │
-    │││ 1.50e+1 │       │
-    │└┴─────────┘       │
-    └───────────────────┘
-    |}]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Hello_world_op.(fun) in file "test/hello_world_op.ml", line 62, characters 14-23
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]


let%expect_test "Print constant tensor" =
Tensor.unsafe_reinitialize ();
@@ -108,7 +102,7 @@ let%expect_test "Print constant tensor" =
Tensor.print ~with_code:false ~with_grad:false `Inline @@ hey;
[%expect
{|
-    [0]: [  1.00 , 2.00 , 3.00  ;  4.00 , 5.00 , 6.00  ]_hey shape 1:3->0:2  [
+    [0]: c2x3_hey shape 1:3->0:2  [
1.00 , 2.00 , 3.00
;  4.00 , 5.00 , 6.00
]
@@ -116,22 +110,22 @@ let%expect_test "Print constant tensor" =
Tensor.print ~with_code:false ~with_grad:false `Default @@ hey;
[%expect
{|
-    ┌────────────────────────────────────────────────────────────────────────┐
-    │[0]: [  1.00 , 2.00 , 3.00  ;  4.00 , 5.00 , 6.00  ]_hey shape 1:3->0:2 │
-    │┌──────┬──────────────────┐                                             │
-    ││      │axis 1            │                                             │
-    │├──────┼──────────────────┤                                             │
-    ││axis 0│ 1.00  2.00  3.00 │                                             │
-    ││      │ 4.00  5.00  6.00 │                                             │
-    │└──────┴──────────────────┘                                             │
-    └────────────────────────────────────────────────────────────────────────┘
+    ┌─────────────────────────────┐
+    │[0]: c2x3_hey shape 1:3->0:2 │
+    │┌──────┬──────────────────┐  │
+    ││      │axis 1            │  │
+    │├──────┼──────────────────┤  │
+    ││axis 0│ 1.00  2.00  3.00 │  │
+    ││      │ 4.00  5.00  6.00 │  │
+    │└──────┴──────────────────┘  │
+    └─────────────────────────────┘
|}];
let%op hoo = [| [ 1; 2; 3 ]; [ 4; 5; 6 ] |] in
Train.forward_and_forget backend ctx hoo;
Tensor.print ~with_code:false ~with_grad:false `Inline @@ hoo;
[%expect
{|
-    [1]: [| [ 1.00 ; 2.00 ; 3.00 ] ; [ 4.00 ; 5.00 ; 6.00 ] |]_hoo shape 0:2|1:3  [|
+    [1]: [| [ 0.00 ; 0.00 ; 0.00 ] ; [ 0.00 ; 0.00 ; 0.00 ] |]_hoo shape 0:2|1:3  [|
[ 1.00 ; 2.00 ; 3.00 ]
; [ 4.00 ; 5.00 ; 6.00 ]
|]
@@ -140,7 +134,7 @@ let%expect_test "Print constant tensor" =
[%expect
{|
┌─────────────────────────────────────────────────────────────────────────────┐
-    │[1]: [| [ 1.00 ; 2.00 ; 3.00 ] ; [ 4.00 ; 5.00 ; 6.00 ] |]_hoo shape 0:2|1:3 │
+    │[1]: [| [ 0.00 ; 0.00 ; 0.00 ] ; [ 0.00 ; 0.00 ; 0.00 ] |]_hoo shape 0:2|1:3 │
│┌──────┬──────────────────┐                                                  │
││      │axis 1            │                                                  │
│├──────┼──────────────────┤                                                  │
@@ -469,31 +463,21 @@ let%expect_test "Matrix multiplication dims 2x3" =
let%op y = ("hey" 7.0 * [ 2; 3 ]) + [ 4; 5; 6 ] in
Train.forward_and_forget backend ctx y;
Tensor.print ~with_code:false ~with_grad:false `Default @@ hey;
-  [%expect
-    {|
-    ┌────────────────────────┐
-    │[0]: hey shape 1:2->0:3 │
-    │┌──────┬────────────┐   │
-    ││      │axis 1      │   │
-    │├──────┼────────────┤   │
-    ││axis 0│ 7.00  7.00 │   │
-    ││      │ 7.00  7.00 │   │
-    ││      │ 7.00  7.00 │   │
-    │└──────┴────────────┘   │
-    └────────────────────────┘
-    |}];
+  [%expect.unreachable];
Tensor.print ~with_code:false ~with_grad:false `Default @@ y;
-  [%expect
-    {|
-    ┌──────────────────────────────┐
-    │[6]: +_y shape 0:3            │
-    │┌┬───────────────────────────┐│
-    │││axis 0                     ││
-    │├┼───────────────────────────┤│
-    │││ 3.90e+1  4.00e+1  4.10e+1 ││
-    │└┴───────────────────────────┘│
-    └──────────────────────────────┘
-    |}]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Hello_world_op.(fun) in file "test/hello_world_op.ml", line 469, characters 14-23
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]


let%expect_test "Big matrix" =
Tensor.unsafe_reinitialize ();
@@ -515,72 +499,25 @@ let%expect_test "Big matrix" =
let y = TDSL.O.((hey * zero_to_twenty) + zero_to_twenty) in
Train.forward_and_forget backend ctx y;
Tensor.print ~with_code:false ~with_grad:false `Inline zero_to_twenty;
-  [%expect
-    {|
-    [2]: 0...20 shape 0:21  [
-      0.00
-      ; 1.00
-      ; 2.00
-      ; 3.00
-      ; 4.00
-      ; 5.00
-      ; 6.00
-      ; 7.00
-      ; 8.00
-      ; 9.00
-      ; 10.00
-      ; 11.00
-      ; 12.00
-      ; 13.00
-      ; 14.00
-      ; 15.00
-      ; 16.00
-      ; 17.00
-      ; 18.00
-      ; 19.00
-      ; 20.00
-    ]
-    |}];
+  [%expect.unreachable];
Tensor.print ~with_code:false ~with_grad:false `Default zero_to_twenty;
-  [%expect
-    {|
-    ┌──────────────────────────────────────┐
-    │[2]: 0...20 shape 0:21                │
-    │┌┬───────────────────────────────────┐│
-    │││axis 0                             ││
-    │├┼───────────────────────────────────┤│
-    │││ 0.00  1.00  ...  1.90e+1  2.00e+1 ││
-    │└┴───────────────────────────────────┘│
-    └──────────────────────────────────────┘
-    |}];
+  [%expect.unreachable];
Tensor.print ~with_code:false ~with_grad:false `Default hey;
-  [%expect
-    {|
-    ┌──────────────────────────────────────────────────┐
-    │[0]: hey shape 1:21->0:21                         │
-    │┌──────┬─────────────────────────────────────────┐│
-    ││      │axis 1                                   ││
-    │├──────┼─────────────────────────────────────────┤│
-    ││axis 0│ 5.00e-1  5.00e-1  ...  5.00e-1  5.00e-1 ││
-    ││      │ 5.00e-1  5.00e-1  ...  5.00e-1  5.00e-1 ││
-    ││      │ ...      ...      ...  ...      ...     ││
-    ││      │ 5.00e-1  5.00e-1  ...  5.00e-1  5.00e-1 ││
-    ││      │ 5.00e-1  5.00e-1  ...  5.00e-1  5.00e-1 ││
-    │└──────┴─────────────────────────────────────────┘│
-    └──────────────────────────────────────────────────┘
-    |}];
+  [%expect.unreachable];
Tensor.print ~with_code:false ~with_grad:false `Default y;
-  [%expect
-    {|
-    ┌────────────────────────────────────────────┐
-    │[5]: + shape 0:21                           │
-    │┌┬─────────────────────────────────────────┐│
-    │││axis 0                                   ││
-    │├┼─────────────────────────────────────────┤│
-    │││ 1.05e+2  1.06e+2  ...  1.24e+2  1.25e+2 ││
-    │└┴─────────────────────────────────────────┘│
-    └────────────────────────────────────────────┘
-    |}]
+  [%expect.unreachable]
+[@@expect.uncaught_exn {|
+  (* CR expect_test_collector: This test expectation appears to contain a backtrace.
+     This is strongly discouraged as backtraces are fragile.
+     Please change this test to not include a backtrace. *)
+  (Invalid_argument "Shape.make: do not provide both batch_dims, batch_axes")
+  Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
+  Called from Ocannl__Shape.make in file "lib/shape.ml", line 904, characters 24-92
+  Called from Ocannl__Tensor.op in file "lib/tensor.ml", line 214, characters 14-74
+  Called from Ocannl__Tensor.param in file "lib/tensor.ml", line 451, characters 8-100
+  Called from Tutorials__Hello_world_op.(fun) in file "test/hello_world_op.ml", line 513, characters 12-39
+  Called from Ppx_expect_runtime__Test_block.Configured.dump_backtrace in file "runtime/test_block.ml", line 142, characters 10-28
+  |}]


let%expect_test "Very big tensor" =
Tensor.unsafe_reinitialize ();
@@ -603,140 +540,7 @@ let%expect_test "Very big tensor" =
Train.forward_and_forget backend ctx hoo;
Tensor.print ~with_code:false ~with_grad:false `Default hey;
[%expect
-    {|
-    ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │[0]: r6x10x11x7x8x9 shape 0:6|3:7,4:8,5:9->1:10,2:11                                                                                                                                   │
-    │┌──────┬─────────────────────────────────────────┬─────────────────────────────────────────┬──────┬─────────────────────────────────────────┬─────────────────────────────────────────┐│
-    ││0 @ 0 │0 @ 4                                    │1 @ 4                                    │~~~~~ │6 @ 4                                    │7 @ 4                                    ││
-    ││      │axis 5                                   │axis 5                                   │axis 5│axis 5                                   │axis 5                                   ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││0 @ 1 │ 0.00     1.00     ...  7.00     8.00    │ 9.00     1.00e+1  ...  1.60e+1  1.70e+1 │ ...  │ 5.40e+1  5.50e+1  ...  6.10e+1  6.20e+1 │ 6.30e+1  6.40e+1  ...  7.00e+1  7.10e+1 ││
-    ││axis 2│ 5.04e+2  5.05e+2  ...  5.11e+2  5.12e+2 │ 5.13e+2  5.14e+2  ...  5.20e+2  5.21e+2 │      │ 5.58e+2  5.59e+2  ...  5.65e+2  5.66e+2 │ 5.67e+2  5.68e+2  ...  5.74e+2  5.75e+2 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 4.53e+3  4.53e+3  ...  4.54e+3  4.54e+3 │ 4.54e+3  4.54e+3  ...  4.55e+3  4.55e+3 │      │ 4.59e+3  4.59e+3  ...  4.59e+3  4.59e+3 │ 4.59e+3  4.60e+3  ...  4.60e+3  4.60e+3 ││
-    ││      │ 5.04e+3  5.04e+3  ...  5.04e+3  5.04e+3 │ 5.04e+3  5.05e+3  ...  5.05e+3  5.05e+3 │      │ 5.09e+3  5.09e+3  ...  5.10e+3  5.10e+3 │ 5.10e+3  5.10e+3  ...  5.11e+3  5.11e+3 ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││1 @ 1 │ 5.54e+3  5.54e+3  ...  5.55e+3  5.55e+3 │ 5.55e+3  5.55e+3  ...  5.56e+3  5.56e+3 │ ...  │ 5.59e+3  5.59e+3  ...  5.60e+3  5.60e+3 │ 5.60e+3  5.60e+3  ...  5.61e+3  5.61e+3 ││
-    ││axis 2│ 6.04e+3  6.04e+3  ...  6.05e+3  6.05e+3 │ 6.05e+3  6.05e+3  ...  6.06e+3  6.06e+3 │      │ 6.10e+3  6.10e+3  ...  6.10e+3  6.11e+3 │ 6.11e+3  6.11e+3  ...  6.11e+3  6.11e+3 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 1.00e+4  1.00e+4  ...  1.00e+4  1.00e+4 │ 1.00e+4  1.00e+4  ...  1.00e+4  1.00e+4 │      │ 1.01e+4  1.01e+4  ...  1.01e+4  1.01e+4 │ 1.01e+4  1.01e+4  ...  1.01e+4  1.01e+4 ││
-    ││      │ 1.05e+4  1.05e+4  ...  1.05e+4  1.05e+4 │ 1.05e+4  1.05e+4  ...  1.06e+4  1.06e+4 │      │ 1.06e+4  1.06e+4  ...  1.06e+4  1.06e+4 │ 1.06e+4  1.06e+4  ...  1.06e+4  1.06e+4 ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││~~~~~ │ ...                                     │ ...                                     │ ...  │ ...                                     │ ...                                     ││
-    ││axis 2│                                         │                                         │      │                                         │                                         ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││8 @ 1 │ 4.43e+4  4.43e+4  ...  4.43e+4  4.43e+4 │ 4.43e+4  4.43e+4  ...  4.43e+4  4.43e+4 │ ...  │ 4.44e+4  4.44e+4  ...  4.44e+4  4.44e+4 │ 4.44e+4  4.44e+4  ...  4.44e+4  4.44e+4 ││
-    ││axis 2│ 4.48e+4  4.48e+4  ...  4.48e+4  4.48e+4 │ 4.48e+4  4.48e+4  ...  4.48e+4  4.48e+4 │      │ 4.49e+4  4.49e+4  ...  4.49e+4  4.49e+4 │ 4.49e+4  4.49e+4  ...  4.49e+4  4.49e+4 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 4.88e+4  4.88e+4  ...  4.88e+4  4.88e+4 │ 4.88e+4  4.88e+4  ...  4.89e+4  4.89e+4 │      │ 4.89e+4  4.89e+4  ...  4.89e+4  4.89e+4 │ 4.89e+4  4.89e+4  ...  4.89e+4  4.89e+4 ││
-    ││      │ 4.93e+4  4.93e+4  ...  4.93e+4  4.94e+4 │ 4.94e+4  4.94e+4  ...  4.94e+4  4.94e+4 │      │ 4.94e+4  4.94e+4  ...  4.94e+4  4.94e+4 │ 4.94e+4  4.94e+4  ...  4.94e+4  4.94e+4 ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││9 @ 1 │ 4.98e+4  4.98e+4  ...  4.99e+4  4.99e+4 │ 4.99e+4  4.99e+4  ...  4.99e+4  4.99e+4 │ ...  │ 4.99e+4  4.99e+4  ...  4.99e+4  4.99e+4 │ 4.99e+4  4.99e+4  ...  4.99e+4  4.99e+4 ││
-    ││axis 2│ 5.04e+4  5.04e+4  ...  5.04e+4  5.04e+4 │ 5.04e+4  5.04e+4  ...  5.04e+4  5.04e+4 │      │ 5.04e+4  5.04e+4  ...  5.04e+4  5.04e+4 │ 5.04e+4  5.04e+4  ...  5.04e+4  5.04e+4 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 5.44e+4  5.44e+4  ...  5.44e+4  5.44e+4 │ 5.44e+4  5.44e+4  ...  5.44e+4  5.44e+4 │      │ 5.44e+4  5.44e+4  ...  5.44e+4  5.44e+4 │ 5.44e+4  5.44e+4  ...  5.45e+4  5.45e+4 ││
-    ││      │ 5.49e+4  5.49e+4  ...  5.49e+4  5.49e+4 │ 5.49e+4  5.49e+4  ...  5.49e+4  5.49e+4 │      │ 5.49e+4  5.49e+4  ...  5.49e+4  5.49e+4 │ 5.49e+4  5.50e+4  ...  5.50e+4  5.50e+4 ││
-    │└──────┴─────────────────────────────────────────┴─────────────────────────────────────────┴──────┴─────────────────────────────────────────┴─────────────────────────────────────────┘│
-    ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
-    │┌──────┬─────────────────────────────────────────┬─────────────────────────────────────────┬──────┬─────────────────────────────────────────┬─────────────────────────────────────────┐│
-    ││1 @ 0 │0 @ 4                                    │1 @ 4                                    │~~~~~ │6 @ 4                                    │7 @ 4                                    ││
-    ││      │axis 5                                   │axis 5                                   │axis 5│axis 5                                   │axis 5                                   ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││0 @ 1 │ 5.54e+4  5.54e+4  ...  5.54e+4  5.54e+4 │ 5.54e+4  5.54e+4  ...  5.54e+4  5.54e+4 │ ...  │ 5.54e+4  5.54e+4  ...  5.55e+4  5.55e+4 │ 5.55e+4  5.55e+4  ...  5.55e+4  5.55e+4 ││
-    ││axis 2│ 5.59e+4  5.59e+4  ...  5.59e+4  5.59e+4 │ 5.59e+4  5.59e+4  ...  5.59e+4  5.59e+4 │      │ 5.59e+4  5.59e+4  ...  5.60e+4  5.60e+4 │ 5.60e+4  5.60e+4  ...  5.60e+4  5.60e+4 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 5.99e+4  5.99e+4  ...  5.99e+4  5.99e+4 │ 5.99e+4  5.99e+4  ...  5.99e+4  5.99e+4 │      │ 6.00e+4  6.00e+4  ...  6.00e+4  6.00e+4 │ 6.00e+4  6.00e+4  ...  6.00e+4  6.00e+4 ││
-    ││      │ 6.04e+4  6.04e+4  ...  6.04e+4  6.04e+4 │ 6.04e+4  6.04e+4  ...  6.04e+4  6.04e+4 │      │ 6.05e+4  6.05e+4  ...  6.05e+4  6.05e+4 │ 6.05e+4  6.05e+4  ...  6.05e+4  6.05e+4 ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││1 @ 1 │ 6.09e+4  6.09e+4  ...  6.09e+4  6.09e+4 │ 6.09e+4  6.09e+4  ...  6.10e+4  6.10e+4 │ ...  │ 6.10e+4  6.10e+4  ...  6.10e+4  6.10e+4 │ 6.10e+4  6.10e+4  ...  6.10e+4  6.10e+4 ││
-    ││axis 2│ 6.14e+4  6.14e+4  ...  6.14e+4  6.14e+4 │ 6.14e+4  6.14e+4  ...  6.15e+4  6.15e+4 │      │ 6.15e+4  6.15e+4  ...  6.15e+4  6.15e+4 │ 6.15e+4  6.15e+4  ...  6.15e+4  6.15e+4 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 6.55e+4  6.55e+4  ...  6.55e+4  6.55e+4 │ 6.55e+4  6.55e+4  ...  6.55e+4  6.55e+4 │      │ 6.55e+4  6.55e+4  ...  6.55e+4  6.55e+4 │ 6.55e+4  6.55e+4  ...  6.55e+4  6.55e+4 ││
-    ││      │ 6.60e+4  6.60e+4  ...  6.60e+4  6.60e+4 │ 6.60e+4  6.60e+4  ...  6.60e+4  6.60e+4 │      │ 6.60e+4  6.60e+4  ...  6.60e+4  6.60e+4 │ 6.60e+4  6.60e+4  ...  6.60e+4  6.60e+4 ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││~~~~~ │ ...                                     │ ...                                     │ ...  │ ...                                     │ ...                                     ││
-    ││axis 2│                                         │                                         │      │                                         │                                         ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││8 @ 1 │ 9.97e+4  9.97e+4  ...  9.97e+4  9.98e+4 │ 9.98e+4  9.98e+4  ...  9.98e+4  9.98e+4 │ ...  │ 9.98e+4  9.98e+4  ...  9.98e+4  9.98e+4 │ 9.98e+4  9.98e+4  ...  9.98e+4  9.98e+4 ││
-    ││axis 2│ 1.00e+5  1.00e+5  ...  1.00e+5  1.00e+5 │ 1.00e+5  1.00e+5  ...  1.00e+5  1.00e+5 │      │ 1.00e+5  1.00e+5  ...  1.00e+5  1.00e+5 │ 1.00e+5  1.00e+5  ...  1.00e+5  1.00e+5 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 1.04e+5  1.04e+5  ...  1.04e+5  1.04e+5 │ 1.04e+5  1.04e+5  ...  1.04e+5  1.04e+5 │      │ 1.04e+5  1.04e+5  ...  1.04e+5  1.04e+5 │ 1.04e+5  1.04e+5  ...  1.04e+5  1.04e+5 ││
-    ││      │ 1.04e+5  1.04e+5  ...  1.04e+5  1.04e+5 │ 1.04e+5  1.04e+5  ...  1.04e+5  1.04e+5 │      │ 1.04e+5  1.04e+5  ...  1.04e+5  1.04e+5 │ 1.04e+5  1.04e+5  ...  1.04e+5  1.04e+5 ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││9 @ 1 │ 1.05e+5  1.05e+5  ...  1.05e+5  1.05e+5 │ 1.05e+5  1.05e+5  ...  1.05e+5  1.05e+5 │ ...  │ 1.05e+5  1.05e+5  ...  1.05e+5  1.05e+5 │ 1.05e+5  1.05e+5  ...  1.05e+5  1.05e+5 ││
-    ││axis 2│ 1.05e+5  1.05e+5  ...  1.05e+5  1.05e+5 │ 1.05e+5  1.05e+5  ...  1.05e+5  1.05e+5 │      │ 1.05e+5  1.05e+5  ...  1.05e+5  1.05e+5 │ 1.05e+5  1.05e+5  ...  1.05e+5  1.05e+5 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 1.09e+5  1.09e+5  ...  1.09e+5  1.09e+5 │ 1.09e+5  1.09e+5  ...  1.09e+5  1.09e+5 │      │ 1.09e+5  1.09e+5  ...  1.09e+5  1.09e+5 │ 1.09e+5  1.09e+5  ...  1.09e+5  1.09e+5 ││
-    ││      │ 1.10e+5  1.10e+5  ...  1.10e+5  1.10e+5 │ 1.10e+5  1.10e+5  ...  1.10e+5  1.10e+5 │      │ 1.10e+5  1.10e+5  ...  1.10e+5  1.10e+5 │ 1.10e+5  1.10e+5  ...  1.10e+5  1.10e+5 ││
-    │└──────┴─────────────────────────────────────────┴─────────────────────────────────────────┴──────┴─────────────────────────────────────────┴─────────────────────────────────────────┘│
-    ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
-    │ ...                                                                                                                                                                                   │
-    ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
-    │┌──────┬─────────────────────────────────────────┬─────────────────────────────────────────┬──────┬─────────────────────────────────────────┬─────────────────────────────────────────┐│
-    ││4 @ 0 │0 @ 4                                    │1 @ 4                                    │~~~~~ │6 @ 4                                    │7 @ 4                                    ││
-    ││      │axis 5                                   │axis 5                                   │axis 5│axis 5                                   │axis 5                                   ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││0 @ 1 │ 2.21e+5  2.21e+5  ...  2.21e+5  2.21e+5 │ 2.21e+5  2.21e+5  ...  2.21e+5  2.21e+5 │ ...  │ 2.21e+5  2.21e+5  ...  2.21e+5  2.21e+5 │ 2.21e+5  2.21e+5  ...  2.21e+5  2.21e+5 ││
-    ││axis 2│ 2.22e+5  2.22e+5  ...  2.22e+5  2.22e+5 │ 2.22e+5  2.22e+5  ...  2.22e+5  2.22e+5 │      │ 2.22e+5  2.22e+5  ...  2.22e+5  2.22e+5 │ 2.22e+5  2.22e+5  ...  2.22e+5  2.22e+5 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 2.26e+5  2.26e+5  ...  2.26e+5  2.26e+5 │ 2.26e+5  2.26e+5  ...  2.26e+5  2.26e+5 │      │ 2.26e+5  2.26e+5  ...  2.26e+5  2.26e+5 │ 2.26e+5  2.26e+5  ...  2.26e+5  2.26e+5 ││
-    ││      │ 2.26e+5  2.26e+5  ...  2.26e+5  2.26e+5 │ 2.26e+5  2.26e+5  ...  2.26e+5  2.26e+5 │      │ 2.26e+5  2.26e+5  ...  2.26e+5  2.26e+5 │ 2.26e+5  2.26e+5  ...  2.26e+5  2.26e+5 ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││1 @ 1 │ 2.27e+5  2.27e+5  ...  2.27e+5  2.27e+5 │ 2.27e+5  2.27e+5  ...  2.27e+5  2.27e+5 │ ...  │ 2.27e+5  2.27e+5  ...  2.27e+5  2.27e+5 │ 2.27e+5  2.27e+5  ...  2.27e+5  2.27e+5 ││
-    ││axis 2│ 2.27e+5  2.27e+5  ...  2.27e+5  2.27e+5 │ 2.27e+5  2.27e+5  ...  2.27e+5  2.27e+5 │      │ 2.27e+5  2.27e+5  ...  2.27e+5  2.27e+5 │ 2.27e+5  2.27e+5  ...  2.27e+5  2.27e+5 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 2.31e+5  2.31e+5  ...  2.31e+5  2.31e+5 │ 2.31e+5  2.31e+5  ...  2.31e+5  2.31e+5 │      │ 2.31e+5  2.31e+5  ...  2.31e+5  2.31e+5 │ 2.31e+5  2.31e+5  ...  2.31e+5  2.31e+5 ││
-    ││      │ 2.32e+5  2.32e+5  ...  2.32e+5  2.32e+5 │ 2.32e+5  2.32e+5  ...  2.32e+5  2.32e+5 │      │ 2.32e+5  2.32e+5  ...  2.32e+5  2.32e+5 │ 2.32e+5  2.32e+5  ...  2.32e+5  2.32e+5 ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││~~~~~ │ ...                                     │ ...                                     │ ...  │ ...                                     │ ...                                     ││
-    ││axis 2│                                         │                                         │      │                                         │                                         ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││8 @ 1 │ 2.66e+5  2.66e+5  ...  2.66e+5  2.66e+5 │ 2.66e+5  2.66e+5  ...  2.66e+5  2.66e+5 │ ...  │ 2.66e+5  2.66e+5  ...  2.66e+5  2.66e+5 │ 2.66e+5  2.66e+5  ...  2.66e+5  2.66e+5 ││
-    ││axis 2│ 2.66e+5  2.66e+5  ...  2.66e+5  2.66e+5 │ 2.66e+5  2.66e+5  ...  2.66e+5  2.66e+5 │      │ 2.66e+5  2.66e+5  ...  2.66e+5  2.66e+5 │ 2.66e+5  2.66e+5  ...  2.66e+5  2.66e+5 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 2.70e+5  2.70e+5  ...  2.70e+5  2.70e+5 │ 2.70e+5  2.70e+5  ...  2.70e+5  2.70e+5 │      │ 2.70e+5  2.70e+5  ...  2.70e+5  2.70e+5 │ 2.70e+5  2.70e+5  ...  2.70e+5  2.70e+5 ││
-    ││      │ 2.71e+5  2.71e+5  ...  2.71e+5  2.71e+5 │ 2.71e+5  2.71e+5  ...  2.71e+5  2.71e+5 │      │ 2.71e+5  2.71e+5  ...  2.71e+5  2.71e+5 │ 2.71e+5  2.71e+5  ...  2.71e+5  2.71e+5 ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││9 @ 1 │ 2.71e+5  2.71e+5  ...  2.71e+5  2.71e+5 │ 2.71e+5  2.71e+5  ...  2.71e+5  2.71e+5 │ ...  │ 2.71e+5  2.71e+5  ...  2.71e+5  2.71e+5 │ 2.71e+5  2.71e+5  ...  2.71e+5  2.71e+5 ││
-    ││axis 2│ 2.72e+5  2.72e+5  ...  2.72e+5  2.72e+5 │ 2.72e+5  2.72e+5  ...  2.72e+5  2.72e+5 │      │ 2.72e+5  2.72e+5  ...  2.72e+5  2.72e+5 │ 2.72e+5  2.72e+5  ...  2.72e+5  2.72e+5 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 2.76e+5  2.76e+5  ...  2.76e+5  2.76e+5 │ 2.76e+5  2.76e+5  ...  2.76e+5  2.76e+5 │      │ 2.76e+5  2.76e+5  ...  2.76e+5  2.76e+5 │ 2.76e+5  2.76e+5  ...  2.76e+5  2.76e+5 ││
-    ││      │ 2.76e+5  2.76e+5  ...  2.76e+5  2.76e+5 │ 2.76e+5  2.76e+5  ...  2.76e+5  2.76e+5 │      │ 2.76e+5  2.76e+5  ...  2.76e+5  2.76e+5 │ 2.76e+5  2.76e+5  ...  2.76e+5  2.76e+5 ││
-    │└──────┴─────────────────────────────────────────┴─────────────────────────────────────────┴──────┴─────────────────────────────────────────┴─────────────────────────────────────────┘│
-    ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
-    │┌──────┬─────────────────────────────────────────┬─────────────────────────────────────────┬──────┬─────────────────────────────────────────┬─────────────────────────────────────────┐│
-    ││5 @ 0 │0 @ 4                                    │1 @ 4                                    │~~~~~ │6 @ 4                                    │7 @ 4                                    ││
-    ││      │axis 5                                   │axis 5                                   │axis 5│axis 5                                   │axis 5                                   ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││0 @ 1 │ 2.77e+5  2.77e+5  ...  2.77e+5  2.77e+5 │ 2.77e+5  2.77e+5  ...  2.77e+5  2.77e+5 │ ...  │ 2.77e+5  2.77e+5  ...  2.77e+5  2.77e+5 │ 2.77e+5  2.77e+5  ...  2.77e+5  2.77e+5 ││
-    ││axis 2│ 2.77e+5  2.77e+5  ...  2.77e+5  2.77e+5 │ 2.77e+5  2.77e+5  ...  2.77e+5  2.77e+5 │      │ 2.77e+5  2.77e+5  ...  2.77e+5  2.77e+5 │ 2.77e+5  2.77e+5  ...  2.77e+5  2.77e+5 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 2.81e+5  2.81e+5  ...  2.81e+5  2.81e+5 │ 2.81e+5  2.81e+5  ...  2.81e+5  2.81e+5 │      │ 2.81e+5  2.81e+5  ...  2.81e+5  2.81e+5 │ 2.81e+5  2.81e+5  ...  2.81e+5  2.81e+5 ││
-    ││      │ 2.82e+5  2.82e+5  ...  2.82e+5  2.82e+5 │ 2.82e+5  2.82e+5  ...  2.82e+5  2.82e+5 │      │ 2.82e+5  2.82e+5  ...  2.82e+5  2.82e+5 │ 2.82e+5  2.82e+5  ...  2.82e+5  2.82e+5 ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││1 @ 1 │ 2.82e+5  2.82e+5  ...  2.82e+5  2.82e+5 │ 2.82e+5  2.82e+5  ...  2.82e+5  2.82e+5 │ ...  │ 2.82e+5  2.82e+5  ...  2.82e+5  2.82e+5 │ 2.82e+5  2.82e+5  ...  2.82e+5  2.82e+5 ││
-    ││axis 2│ 2.83e+5  2.83e+5  ...  2.83e+5  2.83e+5 │ 2.83e+5  2.83e+5  ...  2.83e+5  2.83e+5 │      │ 2.83e+5  2.83e+5  ...  2.83e+5  2.83e+5 │ 2.83e+5  2.83e+5  ...  2.83e+5  2.83e+5 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 2.87e+5  2.87e+5  ...  2.87e+5  2.87e+5 │ 2.87e+5  2.87e+5  ...  2.87e+5  2.87e+5 │      │ 2.87e+5  2.87e+5  ...  2.87e+5  2.87e+5 │ 2.87e+5  2.87e+5  ...  2.87e+5  2.87e+5 ││
-    ││      │ 2.87e+5  2.87e+5  ...  2.87e+5  2.87e+5 │ 2.87e+5  2.87e+5  ...  2.87e+5  2.87e+5 │      │ 2.87e+5  2.87e+5  ...  2.87e+5  2.87e+5 │ 2.87e+5  2.87e+5  ...  2.87e+5  2.87e+5 ││
-    │├──────┼────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││~~~~~ │ ...                                     │ ...                                     │ ...  │ ...                                     │ ...                                     ││
-    ││axis 2│                                         │                                         │      │                                         │                                         ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││8 @ 1 │ 3.21e+5  3.21e+5  ...  3.21e+5  3.21e+5 │ 3.21e+5  3.21e+5  ...  3.21e+5  3.21e+5 │ ...  │ 3.21e+5  3.21e+5  ...  3.21e+5  3.21e+5 │ 3.21e+5  3.21e+5  ...  3.21e+5  3.21e+5 ││
-    ││axis 2│ 3.22e+5  3.22e+5  ...  3.22e+5  3.22e+5 │ 3.22e+5  3.22e+5  ...  3.22e+5  3.22e+5 │      │ 3.22e+5  3.22e+5  ...  3.22e+5  3.22e+5 │ 3.22e+5  3.22e+5  ...  3.22e+5  3.22e+5 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 3.26e+5  3.26e+5  ...  3.26e+5  3.26e+5 │ 3.26e+5  3.26e+5  ...  3.26e+5  3.26e+5 │      │ 3.26e+5  3.26e+5  ...  3.26e+5  3.26e+5 │ 3.26e+5  3.26e+5  ...  3.26e+5  3.26e+5 ││
-    ││      │ 3.26e+5  3.26e+5  ...  3.26e+5  3.26e+5 │ 3.26e+5  3.26e+5  ...  3.26e+5  3.26e+5 │      │ 3.26e+5  3.26e+5  ...  3.26e+5  3.26e+5 │ 3.26e+5  3.26e+5  ...  3.26e+5  3.26e+5 ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼──────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││9 @ 1 │ 3.27e+5  3.27e+5  ...  3.27e+5  3.27e+5 │ 3.27e+5  3.27e+5  ...  3.27e+5  3.27e+5 │ ...  │ 3.27e+5  3.27e+5  ...  3.27e+5  3.27e+5 │ 3.27e+5  3.27e+5  ...  3.27e+5  3.27e+5 ││
-    ││axis 2│ 3.27e+5  3.27e+5  ...  3.27e+5  3.27e+5 │ 3.27e+5  3.27e+5  ...  3.27e+5  3.27e+5 │      │ 3.27e+5  3.27e+5  ...  3.27e+5  3.27e+5 │ 3.27e+5  3.27e+5  ...  3.27e+5  3.27e+5 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 3.31e+5  3.31e+5  ...  3.31e+5  3.31e+5 │ 3.31e+5  3.31e+5  ...  3.31e+5  3.31e+5 │      │ 3.31e+5  3.31e+5  ...  3.31e+5  3.31e+5 │ 3.31e+5  3.31e+5  ...  3.31e+5  3.31e+5 ││
-    ││      │ 3.32e+5  3.32e+5  ...  3.32e+5  3.32e+5 │ 3.32e+5  3.32e+5  ...  3.32e+5  3.32e+5 │      │ 3.32e+5  3.32e+5  ...  3.32e+5  3.32e+5 │ 3.32e+5  3.32e+5  ...  3.32e+5  3.32e+5 ││
-    │└──────┴─────────────────────────────────────────┴─────────────────────────────────────────┴──────┴─────────────────────────────────────────┴─────────────────────────────────────────┘│
-    └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
-    |}];
+    {| [0]: r6x10x11x7x8x9 shape 0:6|3:7,4:8,5:9->1:10,2:11  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default hoo;
(* Disable line wrapping for viewing the output. In VSCode: `View: Toggle Word Wrap`. *)
[%expect
File "test/einsum_trivia.ml", line 1, characters 0-0:
/usr/sbin/git --no-pager diff --no-index --color=always -u _build/default/test/einsum_trivia.ml _build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/einsum_trivia.ml.corrected
diff --git a/_build/default/test/einsum_trivia.ml b/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/einsum_trivia.ml.corrected
index 35a36fa..bbea284 100644
--- a/_build/default/test/einsum_trivia.ml
+++ b/_build/.sandbox/9eb11549a478d75f8149d7db283a0e42/default/test/einsum_trivia.ml.corrected
@@ -28,20 +28,7 @@ let%expect_test "einsum1 permute axes" =
Train.forward_and_forget backend ctx ho;
Tensor.print ~with_code:false ~with_grad:false `Default @@ hey;
[%expect
-    {|
-    ┌─────────────────────────────────────────────────────────────┐
-    │[0]: r2x4x3 shape 0:2|2:3->1:4                               │
-    │┌──────┬────────────────────────┬───────────────────────────┐│
-    ││      │0 @ 0                   │1 @ 0                      ││
-    ││      │axis 2                  │axis 2                     ││
-    │├──────┼────────────────────────┼───────────────────────────┤│
-    ││axis 1│ 0.00  1.00     2.00    │ 1.20e+1  1.30e+1  1.40e+1 ││
-    ││      │ 3.00  4.00     5.00    │ 1.50e+1  1.60e+1  1.70e+1 ││
-    ││      │ 6.00  7.00     8.00    │ 1.80e+1  1.90e+1  2.00e+1 ││
-    ││      │ 9.00  1.00e+1  1.10e+1 │ 2.10e+1  2.20e+1  2.30e+1 ││
-    │└──────┴────────────────────────┴───────────────────────────┘│
-    └─────────────────────────────────────────────────────────────┘
-    |}];
+    {| [0]: r2x4x3 shape 0:2|2:3->1:4  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ ho;
[%expect
{|
@@ -64,106 +51,7 @@ let%expect_test "einsum1 permute axes" =
Train.forward_and_forget backend ctx ho2;
Tensor.print ~with_code:false ~with_grad:false `Default @@ hey2;
[%expect
-    {|
-    ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │[2]: r2x3x6x7x4x5 shape 0:2,1:3|4:4,5:5->2:6,3:7                                                                                                                                                │
-    │┌──────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┐│
-    ││0 @ 1 │0 @ 4                                        │1 @ 4                                        │2 @ 4                                        │3 @ 4                                        ││
-    ││      │axis 5                                       │axis 5                                       │axis 5                                       │axis 5                                       ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││0 @ 2 │ 0.00     1.00     2.00     3.00     4.00    │ 5.00     6.00     7.00     8.00     9.00    │ 1.00e+1  1.10e+1  1.20e+1  1.30e+1  1.40e+1 │ 1.50e+1  1.60e+1  1.70e+1  1.80e+1  1.90e+1 ││
-    ││axis 3│ 2.00e+1  2.10e+1  2.20e+1  2.30e+1  2.40e+1 │ 2.50e+1  2.60e+1  2.70e+1  2.80e+1  2.90e+1 │ 3.00e+1  3.10e+1  3.20e+1  3.30e+1  3.40e+1 │ 3.50e+1  3.60e+1  3.70e+1  3.80e+1  3.90e+1 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 1.00e+2  1.01e+2  1.02e+2  1.03e+2  1.04e+2 │ 1.05e+2  1.06e+2  1.07e+2  1.08e+2  1.09e+2 │ 1.10e+2  1.11e+2  1.12e+2  1.13e+2  1.14e+2 │ 1.15e+2  1.16e+2  1.17e+2  1.18e+2  1.19e+2 ││
-    ││      │ 1.20e+2  1.21e+2  1.22e+2  1.23e+2  1.24e+2 │ 1.25e+2  1.26e+2  1.27e+2  1.28e+2  1.29e+2 │ 1.30e+2  1.31e+2  1.32e+2  1.33e+2  1.34e+2 │ 1.35e+2  1.36e+2  1.37e+2  1.38e+2  1.39e+2 ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││1 @ 2 │ 1.40e+2  1.41e+2  1.42e+2  1.43e+2  1.44e+2 │ 1.45e+2  1.46e+2  1.47e+2  1.48e+2  1.49e+2 │ 1.50e+2  1.51e+2  1.52e+2  1.53e+2  1.54e+2 │ 1.55e+2  1.56e+2  1.57e+2  1.58e+2  1.59e+2 ││
-    ││axis 3│ 1.60e+2  1.61e+2  1.62e+2  1.63e+2  1.64e+2 │ 1.65e+2  1.66e+2  1.67e+2  1.68e+2  1.69e+2 │ 1.70e+2  1.71e+2  1.72e+2  1.73e+2  1.74e+2 │ 1.75e+2  1.76e+2  1.77e+2  1.78e+2  1.79e+2 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 2.40e+2  2.41e+2  2.42e+2  2.43e+2  2.44e+2 │ 2.45e+2  2.46e+2  2.47e+2  2.48e+2  2.49e+2 │ 2.50e+2  2.51e+2  2.52e+2  2.53e+2  2.54e+2 │ 2.55e+2  2.56e+2  2.57e+2  2.58e+2  2.59e+2 ││
-    ││      │ 2.60e+2  2.61e+2  2.62e+2  2.63e+2  2.64e+2 │ 2.65e+2  2.66e+2  2.67e+2  2.68e+2  2.69e+2 │ 2.70e+2  2.71e+2  2.72e+2  2.73e+2  2.74e+2 │ 2.75e+2  2.76e+2  2.77e+2  2.78e+2  2.79e+2 ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││~~~~~ │ ...                                         │ ...                                         │ ...                                         │ ...                                         ││
-    ││axis 3│                                             │                                             │                                             │                                             ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││4 @ 2 │ 5.60e+2  5.61e+2  5.62e+2  5.63e+2  5.64e+2 │ 5.65e+2  5.66e+2  5.67e+2  5.68e+2  5.69e+2 │ 5.70e+2  5.71e+2  5.72e+2  5.73e+2  5.74e+2 │ 5.75e+2  5.76e+2  5.77e+2  5.78e+2  5.79e+2 ││
-    ││axis 3│ 5.80e+2  5.81e+2  5.82e+2  5.83e+2  5.84e+2 │ 5.85e+2  5.86e+2  5.87e+2  5.88e+2  5.89e+2 │ 5.90e+2  5.91e+2  5.92e+2  5.93e+2  5.94e+2 │ 5.95e+2  5.96e+2  5.97e+2  5.98e+2  5.99e+2 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 6.60e+2  6.61e+2  6.62e+2  6.63e+2  6.64e+2 │ 6.65e+2  6.66e+2  6.67e+2  6.68e+2  6.69e+2 │ 6.70e+2  6.71e+2  6.72e+2  6.73e+2  6.74e+2 │ 6.75e+2  6.76e+2  6.77e+2  6.78e+2  6.79e+2 ││
-    ││      │ 6.80e+2  6.81e+2  6.82e+2  6.83e+2  6.84e+2 │ 6.85e+2  6.86e+2  6.87e+2  6.88e+2  6.89e+2 │ 6.90e+2  6.91e+2  6.92e+2  6.93e+2  6.94e+2 │ 6.95e+2  6.96e+2  6.97e+2  6.98e+2  6.99e+2 ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││5 @ 2 │ 7.00e+2  7.01e+2  7.02e+2  7.03e+2  7.04e+2 │ 7.05e+2  7.06e+2  7.07e+2  7.08e+2  7.09e+2 │ 7.10e+2  7.11e+2  7.12e+2  7.13e+2  7.14e+2 │ 7.15e+2  7.16e+2  7.17e+2  7.18e+2  7.19e+2 ││
-    ││axis 3│ 7.20e+2  7.21e+2  7.22e+2  7.23e+2  7.24e+2 │ 7.25e+2  7.26e+2  7.27e+2  7.28e+2  7.29e+2 │ 7.30e+2  7.31e+2  7.32e+2  7.33e+2  7.34e+2 │ 7.35e+2  7.36e+2  7.37e+2  7.38e+2  7.39e+2 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 8.00e+2  8.01e+2  8.02e+2  8.03e+2  8.04e+2 │ 8.05e+2  8.06e+2  8.07e+2  8.08e+2  8.09e+2 │ 8.10e+2  8.11e+2  8.12e+2  8.13e+2  8.14e+2 │ 8.15e+2  8.16e+2  8.17e+2  8.18e+2  8.19e+2 ││
-    ││      │ 8.20e+2  8.21e+2  8.22e+2  8.23e+2  8.24e+2 │ 8.25e+2  8.26e+2  8.27e+2  8.28e+2  8.29e+2 │ 8.30e+2  8.31e+2  8.32e+2  8.33e+2  8.34e+2 │ 8.35e+2  8.36e+2  8.37e+2  8.38e+2  8.39e+2 ││
-    │└──────┴─────────────────────────────────────────────┴─────────────────────────────────────────────┴─────────────────────────────────────────────┴─────────────────────────────────────────────┘│
-    ├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
-    │┌──────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┐│
-    ││1 @ 1 │0 @ 4                                        │1 @ 4                                        │2 @ 4                                        │3 @ 4                                        ││
-    ││      │axis 5                                       │axis 5                                       │axis 5                                       │axis 5                                       ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││0 @ 2 │ 8.40e+2  8.41e+2  8.42e+2  8.43e+2  8.44e+2 │ 8.45e+2  8.46e+2  8.47e+2  8.48e+2  8.49e+2 │ 8.50e+2  8.51e+2  8.52e+2  8.53e+2  8.54e+2 │ 8.55e+2  8.56e+2  8.57e+2  8.58e+2  8.59e+2 ││
-    ││axis 3│ 8.60e+2  8.61e+2  8.62e+2  8.63e+2  8.64e+2 │ 8.65e+2  8.66e+2  8.67e+2  8.68e+2  8.69e+2 │ 8.70e+2  8.71e+2  8.72e+2  8.73e+2  8.74e+2 │ 8.75e+2  8.76e+2  8.77e+2  8.78e+2  8.79e+2 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 9.40e+2  9.41e+2  9.42e+2  9.43e+2  9.44e+2 │ 9.45e+2  9.46e+2  9.47e+2  9.48e+2  9.49e+2 │ 9.50e+2  9.51e+2  9.52e+2  9.53e+2  9.54e+2 │ 9.55e+2  9.56e+2  9.57e+2  9.58e+2  9.59e+2 ││
-    ││      │ 9.60e+2  9.61e+2  9.62e+2  9.63e+2  9.64e+2 │ 9.65e+2  9.66e+2  9.67e+2  9.68e+2  9.69e+2 │ 9.70e+2  9.71e+2  9.72e+2  9.73e+2  9.74e+2 │ 9.75e+2  9.76e+2  9.77e+2  9.78e+2  9.79e+2 ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││1 @ 2 │ 9.80e+2  9.81e+2  9.82e+2  9.83e+2  9.84e+2 │ 9.85e+2  9.86e+2  9.87e+2  9.88e+2  9.89e+2 │ 9.90e+2  9.91e+2  9.92e+2  9.93e+2  9.94e+2 │ 9.95e+2  9.96e+2  9.97e+2  9.98e+2  9.99e+2 ││
-    ││axis 3│ 1.00e+3  1.00e+3  1.00e+3  1.00e+3  1.00e+3 │ 1.00e+3  1.00e+3  1.00e+3  1.00e+3  1.00e+3 │ 1.01e+3  1.01e+3  1.01e+3  1.01e+3  1.01e+3 │ 1.01e+3  1.01e+3  1.01e+3  1.01e+3  1.01e+3 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 1.08e+3  1.08e+3  1.08e+3  1.08e+3  1.08e+3 │ 1.08e+3  1.08e+3  1.08e+3  1.08e+3  1.08e+3 │ 1.09e+3  1.09e+3  1.09e+3  1.09e+3  1.09e+3 │ 1.09e+3  1.09e+3  1.09e+3  1.09e+3  1.09e+3 ││
-    ││      │ 1.10e+3  1.10e+3  1.10e+3  1.10e+3  1.10e+3 │ 1.10e+3  1.10e+3  1.10e+3  1.10e+3  1.10e+3 │ 1.11e+3  1.11e+3  1.11e+3  1.11e+3  1.11e+3 │ 1.11e+3  1.11e+3  1.11e+3  1.11e+3  1.11e+3 ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││~~~~~ │ ...                                         │ ...                                         │ ...                                         │ ...                                         ││
-    ││axis 3│                                             │                                             │                                             │                                             ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││4 @ 2 │ 1.40e+3  1.40e+3  1.40e+3  1.40e+3  1.40e+3 │ 1.40e+3  1.40e+3  1.40e+3  1.40e+3  1.40e+3 │ 1.41e+3  1.41e+3  1.41e+3  1.41e+3  1.41e+3 │ 1.41e+3  1.41e+3  1.41e+3  1.41e+3  1.41e+3 ││
-    ││axis 3│ 1.42e+3  1.42e+3  1.42e+3  1.42e+3  1.42e+3 │ 1.42e+3  1.42e+3  1.42e+3  1.42e+3  1.42e+3 │ 1.43e+3  1.43e+3  1.43e+3  1.43e+3  1.43e+3 │ 1.43e+3  1.43e+3  1.43e+3  1.43e+3  1.43e+3 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 1.50e+3  1.50e+3  1.50e+3  1.50e+3  1.50e+3 │ 1.50e+3  1.50e+3  1.50e+3  1.50e+3  1.50e+3 │ 1.51e+3  1.51e+3  1.51e+3  1.51e+3  1.51e+3 │ 1.51e+3  1.51e+3  1.51e+3  1.51e+3  1.51e+3 ││
-    ││      │ 1.52e+3  1.52e+3  1.52e+3  1.52e+3  1.52e+3 │ 1.52e+3  1.52e+3  1.52e+3  1.52e+3  1.52e+3 │ 1.53e+3  1.53e+3  1.53e+3  1.53e+3  1.53e+3 │ 1.53e+3  1.53e+3  1.53e+3  1.53e+3  1.53e+3 ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││5 @ 2 │ 1.54e+3  1.54e+3  1.54e+3  1.54e+3  1.54e+3 │ 1.54e+3  1.54e+3  1.54e+3  1.54e+3  1.54e+3 │ 1.55e+3  1.55e+3  1.55e+3  1.55e+3  1.55e+3 │ 1.55e+3  1.55e+3  1.55e+3  1.55e+3  1.55e+3 ││
-    ││axis 3│ 1.56e+3  1.56e+3  1.56e+3  1.56e+3  1.56e+3 │ 1.56e+3  1.56e+3  1.56e+3  1.56e+3  1.56e+3 │ 1.57e+3  1.57e+3  1.57e+3  1.57e+3  1.57e+3 │ 1.57e+3  1.57e+3  1.57e+3  1.57e+3  1.57e+3 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 1.64e+3  1.64e+3  1.64e+3  1.64e+3  1.64e+3 │ 1.64e+3  1.64e+3  1.64e+3  1.64e+3  1.64e+3 │ 1.65e+3  1.65e+3  1.65e+3  1.65e+3  1.65e+3 │ 1.65e+3  1.65e+3  1.65e+3  1.65e+3  1.65e+3 ││
-    ││      │ 1.66e+3  1.66e+3  1.66e+3  1.66e+3  1.66e+3 │ 1.66e+3  1.66e+3  1.66e+3  1.66e+3  1.66e+3 │ 1.67e+3  1.67e+3  1.67e+3  1.67e+3  1.67e+3 │ 1.67e+3  1.67e+3  1.67e+3  1.67e+3  1.67e+3 ││
-    │└──────┴─────────────────────────────────────────────┴─────────────────────────────────────────────┴─────────────────────────────────────────────┴─────────────────────────────────────────────┘│
-    ├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
-    │┌──────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┐│
-    ││2 @ 1 │0 @ 4                                        │1 @ 4                                        │2 @ 4                                        │3 @ 4                                        ││
-    ││      │axis 5                                       │axis 5                                       │axis 5                                       │axis 5                                       ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││0 @ 2 │ 1.68e+3  1.68e+3  1.68e+3  1.68e+3  1.68e+3 │ 1.68e+3  1.68e+3  1.68e+3  1.68e+3  1.68e+3 │ 1.69e+3  1.69e+3  1.69e+3  1.69e+3  1.69e+3 │ 1.69e+3  1.69e+3  1.69e+3  1.69e+3  1.69e+3 ││
-    ││axis 3│ 1.70e+3  1.70e+3  1.70e+3  1.70e+3  1.70e+3 │ 1.70e+3  1.70e+3  1.70e+3  1.70e+3  1.70e+3 │ 1.71e+3  1.71e+3  1.71e+3  1.71e+3  1.71e+3 │ 1.71e+3  1.71e+3  1.71e+3  1.71e+3  1.71e+3 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 1.78e+3  1.78e+3  1.78e+3  1.78e+3  1.78e+3 │ 1.78e+3  1.78e+3  1.78e+3  1.78e+3  1.78e+3 │ 1.79e+3  1.79e+3  1.79e+3  1.79e+3  1.79e+3 │ 1.79e+3  1.79e+3  1.79e+3  1.79e+3  1.79e+3 ││
-    ││      │ 1.80e+3  1.80e+3  1.80e+3  1.80e+3  1.80e+3 │ 1.80e+3  1.80e+3  1.80e+3  1.80e+3  1.80e+3 │ 1.81e+3  1.81e+3  1.81e+3  1.81e+3  1.81e+3 │ 1.81e+3  1.81e+3  1.81e+3  1.81e+3  1.81e+3 ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││1 @ 2 │ 1.82e+3  1.82e+3  1.82e+3  1.82e+3  1.82e+3 │ 1.82e+3  1.82e+3  1.82e+3  1.82e+3  1.82e+3 │ 1.83e+3  1.83e+3  1.83e+3  1.83e+3  1.83e+3 │ 1.83e+3  1.83e+3  1.83e+3  1.83e+3  1.83e+3 ││
-    ││axis 3│ 1.84e+3  1.84e+3  1.84e+3  1.84e+3  1.84e+3 │ 1.84e+3  1.84e+3  1.84e+3  1.84e+3  1.84e+3 │ 1.85e+3  1.85e+3  1.85e+3  1.85e+3  1.85e+3 │ 1.85e+3  1.85e+3  1.85e+3  1.85e+3  1.85e+3 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 1.92e+3  1.92e+3  1.92e+3  1.92e+3  1.92e+3 │ 1.92e+3  1.92e+3  1.92e+3  1.92e+3  1.92e+3 │ 1.93e+3  1.93e+3  1.93e+3  1.93e+3  1.93e+3 │ 1.93e+3  1.93e+3  1.93e+3  1.93e+3  1.93e+3 ││
-    ││      │ 1.94e+3  1.94e+3  1.94e+3  1.94e+3  1.94e+3 │ 1.94e+3  1.94e+3  1.94e+3  1.94e+3  1.94e+3 │ 1.95e+3  1.95e+3  1.95e+3  1.95e+3  1.95e+3 │ 1.95e+3  1.95e+3  1.95e+3  1.95e+3  1.95e+3 ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││~~~~~ │ ...                                         │ ...                                         │ ...                                         │ ...                                         ││
-    ││axis 3│                                             │                                             │                                             │                                             ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││4 @ 2 │ 2.24e+3  2.24e+3  2.24e+3  2.24e+3  2.24e+3 │ 2.24e+3  2.24e+3  2.24e+3  2.24e+3  2.24e+3 │ 2.25e+3  2.25e+3  2.25e+3  2.25e+3  2.25e+3 │ 2.25e+3  2.25e+3  2.25e+3  2.25e+3  2.25e+3 ││
-    ││axis 3│ 2.26e+3  2.26e+3  2.26e+3  2.26e+3  2.26e+3 │ 2.26e+3  2.26e+3  2.26e+3  2.26e+3  2.26e+3 │ 2.27e+3  2.27e+3  2.27e+3  2.27e+3  2.27e+3 │ 2.27e+3  2.27e+3  2.27e+3  2.27e+3  2.27e+3 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 2.34e+3  2.34e+3  2.34e+3  2.34e+3  2.34e+3 │ 2.34e+3  2.34e+3  2.34e+3  2.34e+3  2.34e+3 │ 2.35e+3  2.35e+3  2.35e+3  2.35e+3  2.35e+3 │ 2.35e+3  2.35e+3  2.35e+3  2.35e+3  2.35e+3 ││
-    ││      │ 2.36e+3  2.36e+3  2.36e+3  2.36e+3  2.36e+3 │ 2.36e+3  2.36e+3  2.36e+3  2.36e+3  2.36e+3 │ 2.37e+3  2.37e+3  2.37e+3  2.37e+3  2.37e+3 │ 2.37e+3  2.37e+3  2.37e+3  2.37e+3  2.37e+3 ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
-    ││5 @ 2 │ 2.38e+3  2.38e+3  2.38e+3  2.38e+3  2.38e+3 │ 2.38e+3  2.38e+3  2.38e+3  2.38e+3  2.38e+3 │ 2.39e+3  2.39e+3  2.39e+3  2.39e+3  2.39e+3 │ 2.39e+3  2.39e+3  2.39e+3  2.39e+3  2.39e+3 ││
-    ││axis 3│ 2.40e+3  2.40e+3  2.40e+3  2.40e+3  2.40e+3 │ 2.40e+3  2.40e+3  2.40e+3  2.40e+3  2.40e+3 │ 2.41e+3  2.41e+3  2.41e+3  2.41e+3  2.41e+3 │ 2.41e+3  2.41e+3  2.41e+3  2.41e+3  2.41e+3 ││
-    ││      │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     │ ...      ...      ...      ...      ...     ││
-    ││      │ 2.48e+3  2.48e+3  2.48e+3  2.48e+3  2.48e+3 │ 2.48e+3  2.48e+3  2.48e+3  2.48e+3  2.48e+3 │ 2.49e+3  2.49e+3  2.49e+3  2.49e+3  2.49e+3 │ 2.49e+3  2.49e+3  2.49e+3  2.49e+3  2.49e+3 ││
-    ││      │ 2.50e+3  2.50e+3  2.50e+3  2.50e+3  2.50e+3 │ 2.50e+3  2.50e+3  2.50e+3  2.50e+3  2.50e+3 │ 2.51e+3  2.51e+3  2.51e+3  2.51e+3  2.51e+3 │ 2.51e+3  2.51e+3  2.51e+3  2.51e+3  2.51e+3 ││
-    │└──────┴─────────────────────────────────────────────┴─────────────────────────────────────────────┴─────────────────────────────────────────────┴─────────────────────────────────────────────┘│
-    └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
-    |}];
+    {| [2]: r2x3x6x7x4x5 shape 0:2,1:3|4:4,5:5->2:6,3:7  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ ho2;
[%expect
{|
@@ -292,20 +180,7 @@ let%expect_test "einsum1 sum out axes" =
Train.forward_and_forget backend ctx ho;
Tensor.print ~with_code:false ~with_grad:false `Default @@ hey;
[%expect
-    {|
-    ┌─────────────────────────────────────────────────────────────┐
-    │[0]: r2x4x3 shape 0:2|2:3->1:4                               │
-    │┌──────┬────────────────────────┬───────────────────────────┐│
-    ││      │0 @ 0                   │1 @ 0                      ││
-    ││      │axis 2                  │axis 2                     ││
-    │├──────┼────────────────────────┼───────────────────────────┤│
-    ││axis 1│ 0.00  1.00     2.00    │ 1.20e+1  1.30e+1  1.40e+1 ││
-    ││      │ 3.00  4.00     5.00    │ 1.50e+1  1.60e+1  1.70e+1 ││
-    ││      │ 6.00  7.00     8.00    │ 1.80e+1  1.90e+1  2.00e+1 ││
-    ││      │ 9.00  1.00e+1  1.10e+1 │ 2.10e+1  2.20e+1  2.30e+1 ││
-    │└──────┴────────────────────────┴───────────────────────────┘│
-    └─────────────────────────────────────────────────────────────┘
-    |}];
+    {| [0]: r2x4x3 shape 0:2|2:3->1:4  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ ho;
[%expect
{|
@@ -364,28 +239,10 @@ let%expect_test "einsum outer product" =
Train.forward_and_forget backend ctx c;
Tensor.print ~with_code:false ~with_grad:false `Default @@ a;
[%expect
-    {|
-    ┌──────────────────┐
-    │[0]: r2 shape 0:2 │
-    │┌┬────────────┐   │
-    │││axis 0      │   │
-    │├┼────────────┤   │
-    │││ 0.00  1.00 │   │
-    │└┴────────────┘   │
-    └──────────────────┘
-    |}];
+    {| [0]: r2 shape 0:2  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ b;
[%expect
-    {|
-    ┌─────────────────────┐
-    │[1]: r3 shape 0:3    │
-    │┌┬──────────────────┐│
-    │││axis 0            ││
-    │├┼──────────────────┤│
-    │││ 0.00  1.00  2.00 ││
-    │└┴──────────────────┘│
-    └─────────────────────┘
-    |}];
+    {| [1]: r3 shape 0:3  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ c;
[%expect
{|
@@ -406,37 +263,10 @@ let%expect_test "einsum outer product" =
Train.forward_and_forget backend ctx c;
Tensor.print ~with_code:false ~with_grad:false `Default @@ a;
[%expect
-    {|
-    ┌─────────────────────────────────────────────────────────────┐
-    │[5]: r2x4x3 shape 0:2|2:3->1:4                               │
-    │┌──────┬────────────────────────┬───────────────────────────┐│
-    ││      │0 @ 0                   │1 @ 0                      ││
-    ││      │axis 2                  │axis 2                     ││
-    │├──────┼────────────────────────┼───────────────────────────┤│
-    ││axis 1│ 0.00  1.00     2.00    │ 1.20e+1  1.30e+1  1.40e+1 ││
-    ││      │ 3.00  4.00     5.00    │ 1.50e+1  1.60e+1  1.70e+1 ││
-    ││      │ 6.00  7.00     8.00    │ 1.80e+1  1.90e+1  2.00e+1 ││
-    ││      │ 9.00  1.00e+1  1.10e+1 │ 2.10e+1  2.20e+1  2.30e+1 ││
-    │└──────┴────────────────────────┴───────────────────────────┘│
-    └─────────────────────────────────────────────────────────────┘
-    |}];
+    {| [5]: r2x4x3 shape 0:2|2:3->1:4  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ b;
[%expect
-    {|
-    ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │[6]: r5x7x6 shape 0:5|2:6->1:7                                                                                                                                                                                            │
-    │┌──────┬─────────────────────────────────────────┬─────────────────────────────────────────┬─────────────────────────────────────────┬─────────────────────────────────────────┬─────────────────────────────────────────┐│
-    ││      │0 @ 0                                    │1 @ 0                                    │2 @ 0                                    │3 @ 0                                    │4 @ 0                                    ││
-    ││      │axis 2                                   │axis 2                                   │axis 2                                   │axis 2                                   │axis 2                                   ││
-    │├──────┼─────────────────────────────────────────┼─────────────────────────────────────────┼─────────────────────────────────────────┼─────────────────────────────────────────┼─────────────────────────────────────────┤│
-    ││axis 1│ 0.00     1.00     ...  4.00     5.00    │ 4.20e+1  4.30e+1  ...  4.60e+1  4.70e+1 │ 8.40e+1  8.50e+1  ...  8.80e+1  8.90e+1 │ 1.26e+2  1.27e+2  ...  1.30e+2  1.31e+2 │ 1.68e+2  1.69e+2  ...  1.72e+2  1.73e+2 ││
-    ││      │ 6.00     7.00     ...  1.00e+1  1.10e+1 │ 4.80e+1  4.90e+1  ...  5.20e+1  5.30e+1 │ 9.00e+1  9.10e+1  ...  9.40e+1  9.50e+1 │ 1.32e+2  1.33e+2  ...  1.36e+2  1.37e+2 │ 1.74e+2  1.75e+2  ...  1.78e+2  1.79e+2 ││
-    ││      │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     │ ...      ...      ...  ...      ...     ││
-    ││      │ 3.00e+1  3.10e+1  ...  3.40e+1  3.50e+1 │ 7.20e+1  7.30e+1  ...  7.60e+1  7.70e+1 │ 1.14e+2  1.15e+2  ...  1.18e+2  1.19e+2 │ 1.56e+2  1.57e+2  ...  1.60e+2  1.61e+2 │ 1.98e+2  1.99e+2  ...  2.02e+2  2.03e+2 ││
-    ││      │ 3.60e+1  3.70e+1  ...  4.00e+1  4.10e+1 │ 7.80e+1  7.90e+1  ...  8.20e+1  8.30e+1 │ 1.20e+2  1.21e+2  ...  1.24e+2  1.25e+2 │ 1.62e+2  1.63e+2  ...  1.66e+2  1.67e+2 │ 2.04e+2  2.05e+2  ...  2.08e+2  2.09e+2 ││
-    │└──────┴─────────────────────────────────────────┴─────────────────────────────────────────┴─────────────────────────────────────────┴─────────────────────────────────────────┴─────────────────────────────────────────┘│
-    └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
-    |}];
+    {| [6]: r5x7x6 shape 0:5|2:6->1:7  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ c;
[%expect
{|
@@ -723,20 +553,7 @@ let%expect_test "einsum1 broadcast or sum out prefix axes" =
let ctx = Train.forward_and_ctx backend ctx ho in
Tensor.print ~with_code:false ~with_grad:false `Default @@ hey;
[%expect
-    {|
-    ┌─────────────────────────────────────────────────────────────┐
-    │[0]: r2x4x3 shape 0:2|2:3->1:4                               │
-    │┌──────┬────────────────────────┬───────────────────────────┐│
-    ││      │0 @ 0                   │1 @ 0                      ││
-    ││      │axis 2                  │axis 2                     ││
-    │├──────┼────────────────────────┼───────────────────────────┤│
-    ││axis 1│ 0.00  1.00     2.00    │ 1.20e+1  1.30e+1  1.40e+1 ││
-    ││      │ 3.00  4.00     5.00    │ 1.50e+1  1.60e+1  1.70e+1 ││
-    ││      │ 6.00  7.00     8.00    │ 1.80e+1  1.90e+1  2.00e+1 ││
-    ││      │ 9.00  1.00e+1  1.10e+1 │ 2.10e+1  2.20e+1  2.30e+1 ││
-    │└──────┴────────────────────────┴───────────────────────────┘│
-    └─────────────────────────────────────────────────────────────┘
-    |}];
+    {| [0]: r2x4x3 shape 0:2|2:3->1:4  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ ho;
[%expect
{|
@@ -776,106 +593,7 @@ let%expect_test "einsum1 broadcast or sum out prefix axes" =
let ctx = Train.forward_and_ctx backend ctx ho3 in
Tensor.print ~with_code:false ~with_grad:false `Default @@ hey2;
[%expect
-    {|
-    ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │[3]: r2x3x6x7x4x5 shape 0:2,1:3|4:4,5:5->2:6,3:7                                                                                                                                                │
-    │┌──────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┬─────────────────────────────────────────────┐│
-    ││0 @ 1 │0 @ 4                                        │1 @ 4                                        │2 @ 4                                        │3 @ 4                                        ││
-    ││      │axis 5                                       │axis 5                                       │axis 5                                       │axis 5                                       ││
-    │├──────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┼─────────────────────────────────────────────┤│
...TRUNCATED BY DUNE...
Train.forward_and_forget backend ctx f;
Tensor.print ~with_code:false ~with_grad:false `Default @@ d;
[%expect
-    {|
-    ┌─────────────────────────┐
-    │[3]: r3x2 shape 1:2->0:3 │
-    │┌──────┬────────────┐    │
-    ││      │axis 1      │    │
-    │├──────┼────────────┤    │
-    ││axis 0│ 0.00  1.00 │    │
-    ││      │ 2.00  3.00 │    │
-    ││      │ 4.00  5.00 │    │
-    │└──────┴────────────┘    │
-    └─────────────────────────┘
-    |}];
+    {| [3]: r3x2 shape 1:2->0:3  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ e;
[%expect
-    {|
-    ┌───────────────────────────────────────┐
-    │[4]: r3x4 shape 1:4->0:3               │
-    │┌──────┬──────────────────────────────┐│
-    ││      │axis 1                        ││
-    │├──────┼──────────────────────────────┤│
-    ││axis 0│ 0.00  1.00  2.00     3.00    ││
-    ││      │ 4.00  5.00  6.00     7.00    ││
-    ││      │ 8.00  9.00  1.00e+1  1.10e+1 ││
-    │└──────┴──────────────────────────────┘│
-    └───────────────────────────────────────┘
-    |}];
+    {| [4]: r3x4 shape 1:4->0:3  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ f;
[%expect
{|
@@ -1253,20 +888,7 @@ let%expect_test "einsum1 fixed dim axis" =
let ctx = Train.forward_and_ctx backend ctx ho in
Tensor.print ~with_code:false ~with_grad:false `Default @@ hey;
[%expect
-    {|
-    ┌─────────────────────────────────────────────────────────────┐
-    │[0]: r2x4x3 shape 0:2|2:3->1:4                               │
-    │┌──────┬────────────────────────┬───────────────────────────┐│
-    ││      │0 @ 0                   │1 @ 0                      ││
-    ││      │axis 2                  │axis 2                     ││
-    │├──────┼────────────────────────┼───────────────────────────┤│
-    ││axis 1│ 0.00  1.00     2.00    │ 1.20e+1  1.30e+1  1.40e+1 ││
-    ││      │ 3.00  4.00     5.00    │ 1.50e+1  1.60e+1  1.70e+1 ││
-    ││      │ 6.00  7.00     8.00    │ 1.80e+1  1.90e+1  2.00e+1 ││
-    ││      │ 9.00  1.00e+1  1.10e+1 │ 2.10e+1  2.20e+1  2.30e+1 ││
-    │└──────┴────────────────────────┴───────────────────────────┘│
-    └─────────────────────────────────────────────────────────────┘
-    |}];
+    {| [0]: r2x4x3 shape 0:2|2:3->1:4  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ ho;
[%expect
{|
@@ -1284,20 +906,7 @@ let%expect_test "einsum1 fixed dim axis" =
let ctx = Train.forward_and_ctx backend ctx ho2 in
Tensor.print ~with_code:false ~with_grad:false `Default @@ hey;
[%expect
-    {|
-    ┌─────────────────────────────────────────────────────────────┐
-    │[0]: r2x4x3 shape 0:2|2:3->1:4                               │
-    │┌──────┬────────────────────────┬───────────────────────────┐│
-    ││      │0 @ 0                   │1 @ 0                      ││
-    ││      │axis 2                  │axis 2                     ││
-    │├──────┼────────────────────────┼───────────────────────────┤│
-    ││axis 1│ 0.00  1.00     2.00    │ 1.20e+1  1.30e+1  1.40e+1 ││
-    ││      │ 3.00  4.00     5.00    │ 1.50e+1  1.60e+1  1.70e+1 ││
-    ││      │ 6.00  7.00     8.00    │ 1.80e+1  1.90e+1  2.00e+1 ││
-    ││      │ 9.00  1.00e+1  1.10e+1 │ 2.10e+1  2.20e+1  2.30e+1 ││
-    │└──────┴────────────────────────┴───────────────────────────┘│
-    └─────────────────────────────────────────────────────────────┘
-    |}];
+    {| [0]: r2x4x3 shape 0:2|2:3->1:4  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ ho2;
[%expect
{|
@@ -1316,18 +925,7 @@ let%expect_test "einsum1 fixed dim axis" =
let ctx = Train.forward_and_ctx backend ctx ho3 in
Tensor.print ~with_code:false ~with_grad:false `Default @@ hey2;
[%expect
-    {|
-    ┌─────────────────────────┐
-    │[3]: r3x2 shape 1:2->0:3 │
-    │┌──────┬────────────┐    │
-    ││      │axis 1      │    │
-    │├──────┼────────────┤    │
-    ││axis 0│ 0.00  1.00 │    │
-    ││      │ 2.00  3.00 │    │
-    ││      │ 4.00  5.00 │    │
-    │└──────┴────────────┘    │
-    └─────────────────────────┘
-    |}];
+    {| [3]: r3x2 shape 1:2->0:3  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ ho3;
[%expect
{|
@@ -1379,34 +977,10 @@ let%expect_test "einsum with fixed dim axes" =
Train.forward_and_forget backend ctx c;
Tensor.print ~with_code:false ~with_grad:false `Default @@ a;
[%expect
-    {|
-    ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │[0]: r3x2x4 shape 0:3|2:4->1:2                                                                             │
-    │┌──────┬────────────────────────┬────────────────────────────────────┬────────────────────────────────────┐│
-    ││      │0 @ 0                   │1 @ 0                               │2 @ 0                               ││
-    ││      │axis 2                  │axis 2                              │axis 2                              ││
-    │├──────┼────────────────────────┼────────────────────────────────────┼────────────────────────────────────┤│
-    ││axis 1│ 0.00  1.00  2.00  3.00 │ 8.00     9.00     1.00e+1  1.10e+1 │ 1.60e+1  1.70e+1  1.80e+1  1.90e+1 ││
-    ││      │ 4.00  5.00  6.00  7.00 │ 1.20e+1  1.30e+1  1.40e+1  1.50e+1 │ 2.00e+1  2.10e+1  2.20e+1  2.30e+1 ││
-    │└──────┴────────────────────────┴────────────────────────────────────┴────────────────────────────────────┘│
-    └───────────────────────────────────────────────────────────────────────────────────────────────────────────┘
-    |}];
+    {| [0]: r3x2x4 shape 0:3|2:4->1:2  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ b;
[%expect
-    {|
-    ┌────────────────────────────────┐
-    │[1]: r3x4x1 shape 0:3|2:1->1:4  │
-    │┌──────┬──────┬──────┬─────────┐│
-    ││      │0 @ 0 │1 @ 0 │2 @ 0    ││
-    ││      │axis 2│axis 2│axis 2   ││
-    │├──────┼──────┼──────┼─────────┤│
-    ││axis 1│ 0.00 │ 4.00 │ 8.00    ││
-    ││      │ 1.00 │ 5.00 │ 9.00    ││
-    ││      │ 2.00 │ 6.00 │ 1.00e+1 ││
-    ││      │ 3.00 │ 7.00 │ 1.10e+1 ││
-    │└──────┴──────┴──────┴─────────┘│
-    └────────────────────────────────┘
-    |}];
+    {| [1]: r3x4x1 shape 0:3|2:1->1:4  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ c;
[%expect
{|
@@ -1450,175 +1024,175 @@ let%expect_test "outer_sum simulating axis concatenation" =
Tensor.print ~with_code:false ~with_grad:false `Default @@ positions;
[%expect
{|
-    ┌────────────────────────────────┐
-    │[9]: ;=>+ shape 0:4,1:5,2:6,3:3 │
-    │┌──────┬──────────────────┐     │
-    ││0 @ 0 │axis 3            │     │
-    │├──────┼──────────────────┤     │
-    ││0 @ 1 │ 0.00  0.00  0.00 │     │
-    ││axis 2│ 0.00  0.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 0.00  0.00  4.00 │     │
-    ││      │ 0.00  0.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││1 @ 1 │ 0.00  1.00  0.00 │     │
-    ││axis 2│ 0.00  1.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 0.00  1.00  4.00 │     │
-    ││      │ 0.00  1.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││2 @ 1 │ 0.00  2.00  0.00 │     │
-    ││axis 2│ 0.00  2.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 0.00  2.00  4.00 │     │
-    ││      │ 0.00  2.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││3 @ 1 │ 0.00  3.00  0.00 │     │
-    ││axis 2│ 0.00  3.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 0.00  3.00  4.00 │     │
-    ││      │ 0.00  3.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││4 @ 1 │ 0.00  4.00  0.00 │     │
-    ││axis 2│ 0.00  4.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 0.00  4.00  4.00 │     │
-    ││      │ 0.00  4.00  5.00 │     │
-    │└──────┴──────────────────┘     │
-    ├────────────────────────────────┤
-    │┌──────┬──────────────────┐     │
-    ││1 @ 0 │axis 3            │     │
-    │├──────┼──────────────────┤     │
-    ││0 @ 1 │ 1.00  0.00  0.00 │     │
-    ││axis 2│ 1.00  0.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 1.00  0.00  4.00 │     │
-    ││      │ 1.00  0.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││1 @ 1 │ 1.00  1.00  0.00 │     │
-    ││axis 2│ 1.00  1.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 1.00  1.00  4.00 │     │
-    ││      │ 1.00  1.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││2 @ 1 │ 1.00  2.00  0.00 │     │
-    ││axis 2│ 1.00  2.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 1.00  2.00  4.00 │     │
-    ││      │ 1.00  2.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││3 @ 1 │ 1.00  3.00  0.00 │     │
-    ││axis 2│ 1.00  3.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 1.00  3.00  4.00 │     │
-    ││      │ 1.00  3.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││4 @ 1 │ 1.00  4.00  0.00 │     │
-    ││axis 2│ 1.00  4.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 1.00  4.00  4.00 │     │
-    ││      │ 1.00  4.00  5.00 │     │
-    │└──────┴──────────────────┘     │
-    ├────────────────────────────────┤
-    │┌──────┬──────────────────┐     │
-    ││2 @ 0 │axis 3            │     │
-    │├──────┼──────────────────┤     │
-    ││0 @ 1 │ 2.00  0.00  0.00 │     │
-    ││axis 2│ 2.00  0.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 2.00  0.00  4.00 │     │
-    ││      │ 2.00  0.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││1 @ 1 │ 2.00  1.00  0.00 │     │
-    ││axis 2│ 2.00  1.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 2.00  1.00  4.00 │     │
-    ││      │ 2.00  1.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││2 @ 1 │ 2.00  2.00  0.00 │     │
-    ││axis 2│ 2.00  2.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 2.00  2.00  4.00 │     │
-    ││      │ 2.00  2.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││3 @ 1 │ 2.00  3.00  0.00 │     │
-    ││axis 2│ 2.00  3.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 2.00  3.00  4.00 │     │
-    ││      │ 2.00  3.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││4 @ 1 │ 2.00  4.00  0.00 │     │
-    ││axis 2│ 2.00  4.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 2.00  4.00  4.00 │     │
-    ││      │ 2.00  4.00  5.00 │     │
-    │└──────┴──────────────────┘     │
-    ├────────────────────────────────┤
-    │┌──────┬──────────────────┐     │
-    ││3 @ 0 │axis 3            │     │
-    │├──────┼──────────────────┤     │
-    ││0 @ 1 │ 3.00  0.00  0.00 │     │
-    ││axis 2│ 3.00  0.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 3.00  0.00  4.00 │     │
-    ││      │ 3.00  0.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││1 @ 1 │ 3.00  1.00  0.00 │     │
-    ││axis 2│ 3.00  1.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 3.00  1.00  4.00 │     │
-    ││      │ 3.00  1.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││2 @ 1 │ 3.00  2.00  0.00 │     │
-    ││axis 2│ 3.00  2.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 3.00  2.00  4.00 │     │
-    ││      │ 3.00  2.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││3 @ 1 │ 3.00  3.00  0.00 │     │
-    ││axis 2│ 3.00  3.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 3.00  3.00  4.00 │     │
-    ││      │ 3.00  3.00  5.00 │     │
-    │├──────┼──────────────────┤     │
-    ││4 @ 1 │ 3.00  4.00  0.00 │     │
-    ││axis 2│ 3.00  4.00  1.00 │     │
-    ││      │ ...   ...   ...  │     │
-    ││      │ 3.00  4.00  4.00 │     │
-    ││      │ 3.00  4.00  5.00 │     │
-    │└──────┴──────────────────┘     │
-    └────────────────────────────────┘
+    ┌───────────────────────────────────────┐
+    │[9]: ;=>+ shape 0:4,1:5,2:6,3:3        │
+    │┌──────┬──────────────────────────────┐│
+    ││0 @ 0 │axis 3                        ││
+    │├──────┼──────────────────────────────┤│
+    ││0 @ 1 │ 3.74e-4  0.00      0.00      ││
+    ││axis 2│ 3.74e-4  2.89e+32  1.00      ││
+    ││      │ ...      ...       ...       ││
+    ││      │ 7.49e-4  0.00      4.00      ││
+    ││      │ 3.74e-4  1.12e-43  5.00      ││
+    │├──────┼──────────────────────────────┤│
+    ││1 @ 1 │ 3.31e-40  1.00      0.00     ││
+    ││axis 2│ 0.00      2.89e+32  1.00     ││
+    ││      │ ...       ...       ...      ││
+    ││      │ 3.74e-4   1.00      4.00     ││
+    ││      │ 4.28e-41  1.00      5.00     ││
+    │├──────┼──────────────────────────────┤│
+    ││2 @ 1 │ 3.31e-40  2.00      0.00     ││
+    ││axis 2│ 0.00      2.89e+32  1.00     ││
+    ││      │ ...       ...       ...      ││
+    ││      │ 3.74e-4   2.00      4.00     ││
+    ││      │ 4.28e-41  2.00      5.00     ││
+    │├──────┼──────────────────────────────┤│
+    ││3 @ 1 │ 3.31e-40  3.00      0.00     ││
+    ││axis 2│ 0.00      2.89e+32  1.00     ││
+    ││      │ ...       ...       ...      ││
+    ││      │ 3.74e-4   3.00      4.00     ││
+    ││      │ 4.28e-41  3.00      5.00     ││
+    │├──────┼──────────────────────────────┤│
+    ││4 @ 1 │ 3.50e+24  4.00      2.80e-33 ││
+    ││axis 2│ 3.50e+24  2.89e+32  1.00     ││
+    ││      │ ...       ...       ...      ││
+    ││      │ 3.50e+24  4.00      4.00     ││
+    ││      │ 3.50e+24  4.00      5.00     ││
+    │└──────┴──────────────────────────────┘│
+    ├───────────────────────────────────────┤
+    │┌──────┬──────────────────────────────┐│
+    ││1 @ 0 │axis 3                        ││
+    │├──────┼──────────────────────────────┤│
+    ││0 @ 1 │ 1.00  2.89e+32  3.23e+21     ││
+    ││axis 2│ 1.00  5.78e+32  3.23e+21     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 1.00  2.89e+32  3.23e+21     ││
+    ││      │ 1.00  2.89e+32  3.23e+21     ││
+    │├──────┼──────────────────────────────┤│
+    ││1 @ 1 │ 1.00  2.89e+32  3.23e+21     ││
+    ││axis 2│ 1.00  5.78e+32  3.23e+21     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 1.00  2.89e+32  3.23e+21     ││
+    ││      │ 1.00  2.89e+32  3.23e+21     ││
+    │├──────┼──────────────────────────────┤│
+    ││2 @ 1 │ 1.00  2.89e+32  3.23e+21     ││
+    ││axis 2│ 1.00  5.78e+32  3.23e+21     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 1.00  2.89e+32  3.23e+21     ││
+    ││      │ 1.00  2.89e+32  3.23e+21     ││
+    │├──────┼──────────────────────────────┤│
+    ││3 @ 1 │ 1.00  2.89e+32  3.23e+21     ││
+    ││axis 2│ 1.00  5.78e+32  3.23e+21     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 1.00  2.89e+32  3.23e+21     ││
+    ││      │ 1.00  2.89e+32  3.23e+21     ││
+    │├──────┼──────────────────────────────┤│
+    ││4 @ 1 │ 3.50e+24  2.89e+32  3.23e+21 ││
+    ││axis 2│ 3.50e+24  5.78e+32  3.23e+21 ││
+    ││      │ ...       ...       ...      ││
+    ││      │ 3.50e+24  2.89e+32  3.23e+21 ││
+    ││      │ 3.50e+24  2.89e+32  3.23e+21 ││
+    │└──────┴──────────────────────────────┘│
+    ├───────────────────────────────────────┤
+    │┌──────┬──────────────────────────────┐│
+    ││2 @ 0 │axis 3                        ││
+    │├──────┼──────────────────────────────┤│
+    ││0 @ 1 │ 2.00  3.34e-9   1.33e+19     ││
+    ││axis 2│ 2.00  2.89e+32  1.33e+19     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 2.00  3.34e-9   1.33e+19     ││
+    ││      │ 2.00  3.34e-9   1.33e+19     ││
+    │├──────┼──────────────────────────────┤│
+    ││1 @ 1 │ 2.00  1.00      1.33e+19     ││
+    ││axis 2│ 2.00  2.89e+32  1.33e+19     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 2.00  1.00      1.33e+19     ││
+    ││      │ 2.00  1.00      1.33e+19     ││
+    │├──────┼──────────────────────────────┤│
+    ││2 @ 1 │ 2.00  2.00      1.33e+19     ││
+    ││axis 2│ 2.00  2.89e+32  1.33e+19     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 2.00  2.00      1.33e+19     ││
+    ││      │ 2.00  2.00      1.33e+19     ││
+    │├──────┼──────────────────────────────┤│
+    ││3 @ 1 │ 2.00  3.00      1.33e+19     ││
+    ││axis 2│ 2.00  2.89e+32  1.33e+19     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 2.00  3.00      1.33e+19     ││
+    ││      │ 2.00  3.00      1.33e+19     ││
+    │├──────┼──────────────────────────────┤│
+    ││4 @ 1 │ 3.50e+24  4.00      1.33e+19 ││
+    ││axis 2│ 3.50e+24  2.89e+32  1.33e+19 ││
+    ││      │ ...       ...       ...      ││
+    ││      │ 3.50e+24  4.00      1.33e+19 ││
+    ││      │ 3.50e+24  4.00      1.33e+19 ││
+    │└──────┴──────────────────────────────┘│
+    ├───────────────────────────────────────┤
+    │┌──────┬──────────────────────────────┐│
+    ││3 @ 0 │axis 3                        ││
+    │├──────┼──────────────────────────────┤│
+    ││0 @ 1 │ 3.00  1.30e-8   7.52e+28     ││
+    ││axis 2│ 3.00  2.89e+32  7.52e+28     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 3.00  1.30e-8   7.52e+28     ││
+    ││      │ 3.00  1.30e-8   7.52e+28     ││
+    │├──────┼──────────────────────────────┤│
+    ││1 @ 1 │ 3.00  1.00      7.52e+28     ││
+    ││axis 2│ 3.00  2.89e+32  7.52e+28     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 3.00  1.00      7.52e+28     ││
+    ││      │ 3.00  1.00      7.52e+28     ││
+    │├──────┼──────────────────────────────┤│
+    ││2 @ 1 │ 3.00  2.00      7.52e+28     ││
+    ││axis 2│ 3.00  2.89e+32  7.52e+28     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 3.00  2.00      7.52e+28     ││
+    ││      │ 3.00  2.00      7.52e+28     ││
+    │├──────┼──────────────────────────────┤│
+    ││3 @ 1 │ 3.00  3.00      7.52e+28     ││
+    ││axis 2│ 3.00  2.89e+32  7.52e+28     ││
+    ││      │ ...   ...       ...          ││
+    ││      │ 3.00  3.00      7.52e+28     ││
+    ││      │ 3.00  3.00      7.52e+28     ││
+    │├──────┼──────────────────────────────┤│
+    ││4 @ 1 │ 3.50e+24  4.00      7.52e+28 ││
+    ││axis 2│ 3.50e+24  2.89e+32  7.52e+28 ││
+    ││      │ ...       ...       ...      ││
+    ││      │ 3.50e+24  4.00      7.52e+28 ││
+    ││      │ 3.50e+24  4.00      7.52e+28 ││
+    │└──────┴──────────────────────────────┘│
+    └───────────────────────────────────────┘
|}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ ti;
[%expect
{|
-    ┌───────────────────────────┐
-    │[1]: =>_ti shape 0:4,1:3   │
-    │┌──────┬──────────────────┐│
-    ││      │axis 1            ││
-    │├──────┼──────────────────┤│
-    ││axis 0│ 0.00  0.00  0.00 ││
-    ││      │ 1.00  0.00  0.00 ││
-    ││      │ 2.00  0.00  0.00 ││
-    ││      │ 3.00  0.00  0.00 ││
-    │└──────┴──────────────────┘│
-    └───────────────────────────┘
+    ┌───────────────────────────────────┐
+    │[1]: =>_ti shape 0:4,1:3           │
+    │┌──────┬──────────────────────────┐│
+    ││      │axis 1                    ││
+    │├──────┼──────────────────────────┤│
+    ││axis 0│ 0.00  0.00      0.00     ││
+    ││      │ 1.00  2.89e+32  3.23e+21 ││
+    ││      │ 2.00  3.34e-9   1.33e+19 ││
+    ││      │ 3.00  1.30e-8   7.52e+28 ││
+    │└──────┴──────────────────────────┘│
+    └───────────────────────────────────┘
|}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ tk;
[%expect
{|
-    ┌───────────────────────────┐
-    │[7]: =>_tk shape 0:6,1:3   │
-    │┌──────┬──────────────────┐│
-    ││      │axis 1            ││
-    │├──────┼──────────────────┤│
-    ││axis 0│ 0.00  0.00  0.00 ││
-    ││      │ 0.00  0.00  1.00 ││
-    ││      │ ...   ...   ...  ││
-    ││      │ 0.00  0.00  4.00 ││
-    ││      │ 0.00  0.00  5.00 ││
-    │└──────┴──────────────────┘│
-    └───────────────────────────┘
+    ┌───────────────────────────────────┐
+    │[7]: =>_tk shape 0:6,1:3           │
+    │┌──────┬──────────────────────────┐│
+    ││      │axis 1                    ││
+    │├──────┼──────────────────────────┤│
+    ││axis 0│ 3.31e-40  0.00      0.00 ││
+    ││      │ 0.00      2.89e+32  1.00 ││
+    ││      │ ...       ...       ...  ││
+    ││      │ 3.74e-4   0.00      4.00 ││
+    ││      │ 4.28e-41  1.12e-43  5.00 ││
+    │└──────┴──────────────────────────┘│
+    └───────────────────────────────────┘
|}]


let%expect_test "einsum with a leftmost input axis preserved as output axis" =
@@ -1644,54 +1218,10 @@ let%expect_test "einsum with a leftmost input axis preserved as output axis" =
Train.forward_and_forget backend ctx c;
Tensor.print ~with_code:false ~with_grad:false `Default @@ a;
[%expect
-    {|
-    ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │[0]: r3x2x4_a shape 0:3|2:4->1:2                                                                           │
-    │┌──────┬────────────────────────┬────────────────────────────────────┬────────────────────────────────────┐│
-    ││      │0 @ 0                   │1 @ 0                               │2 @ 0                               ││
-    ││      │axis 2                  │axis 2                              │axis 2                              ││
-    │├──────┼────────────────────────┼────────────────────────────────────┼────────────────────────────────────┤│
-    ││axis 1│ 0.00  1.00  2.00  3.00 │ 8.00     9.00     1.00e+1  1.10e+1 │ 1.60e+1  1.70e+1  1.80e+1  1.90e+1 ││
-    ││      │ 4.00  5.00  6.00  7.00 │ 1.20e+1  1.30e+1  1.40e+1  1.50e+1 │ 2.00e+1  2.10e+1  2.20e+1  2.30e+1 ││
-    │└──────┴────────────────────────┴────────────────────────────────────┴────────────────────────────────────┘│
-    └───────────────────────────────────────────────────────────────────────────────────────────────────────────┘
-    |}];
+    {| [0]: r3x2x4_a shape 0:3|2:4->1:2  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ b;
[%expect
-    {|
-    ┌────────────────────────────────────────────────────────────────┐
-    │[1]: r3x4x2x3_b shape 0:3|2:2,3:3->1:4                          │
-    │┌──────┬───────────────────────────┬───────────────────────────┐│
-    ││0 @ 0 │0 @ 2                      │1 @ 2                      ││
-    ││      │axis 3                     │axis 3                     ││
-    │├──────┼───────────────────────────┼───────────────────────────┤│
-    ││axis 1│ 0.00     1.00     2.00    │ 3.00     4.00     5.00    ││
-    ││      │ 6.00     7.00     8.00    │ 9.00     1.00e+1  1.10e+1 ││
-    ││      │ 1.20e+1  1.30e+1  1.40e+1 │ 1.50e+1  1.60e+1  1.70e+1 ││
-    ││      │ 1.80e+1  1.90e+1  2.00e+1 │ 2.10e+1  2.20e+1  2.30e+1 ││
-    │└──────┴───────────────────────────┴───────────────────────────┘│
-    ├────────────────────────────────────────────────────────────────┤
-    │┌──────┬───────────────────────────┬───────────────────────────┐│
-    ││1 @ 0 │0 @ 2                      │1 @ 2                      ││
-    ││      │axis 3                     │axis 3                     ││
-    │├──────┼───────────────────────────┼───────────────────────────┤│
-    ││axis 1│ 2.40e+1  2.50e+1  2.60e+1 │ 2.70e+1  2.80e+1  2.90e+1 ││
-    ││      │ 3.00e+1  3.10e+1  3.20e+1 │ 3.30e+1  3.40e+1  3.50e+1 ││
-    ││      │ 3.60e+1  3.70e+1  3.80e+1 │ 3.90e+1  4.00e+1  4.10e+1 ││
-    ││      │ 4.20e+1  4.30e+1  4.40e+1 │ 4.50e+1  4.60e+1  4.70e+1 ││
-    │└──────┴───────────────────────────┴───────────────────────────┘│
-    ├────────────────────────────────────────────────────────────────┤
-    │┌──────┬───────────────────────────┬───────────────────────────┐│
-    ││2 @ 0 │0 @ 2                      │1 @ 2                      ││
-    ││      │axis 3                     │axis 3                     ││
-    │├──────┼───────────────────────────┼───────────────────────────┤│
-    ││axis 1│ 4.80e+1  4.90e+1  5.00e+1 │ 5.10e+1  5.20e+1  5.30e+1 ││
-    ││      │ 5.40e+1  5.50e+1  5.60e+1 │ 5.70e+1  5.80e+1  5.90e+1 ││
-    ││      │ 6.00e+1  6.10e+1  6.20e+1 │ 6.30e+1  6.40e+1  6.50e+1 ││
-    ││      │ 6.60e+1  6.70e+1  6.80e+1 │ 6.90e+1  7.00e+1  7.10e+1 ││
-    │└──────┴───────────────────────────┴───────────────────────────┘│
-    └────────────────────────────────────────────────────────────────┘
-    |}];
+    {| [1]: r3x4x2x3_b shape 0:3|2:2,3:3->1:4  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ c;
[%expect
{|
@@ -1728,34 +1258,10 @@ let%expect_test "einsum permuting two leftmost input axes as output axes" =
Train.forward_and_forget backend ctx c;
Tensor.print ~with_code:false ~with_grad:false `Default @@ a;
[%expect
-    {|
-    ┌───────────────────────────┐
-    │[0]: r2x2_a shape 1:2->0:2 │
-    │┌──────┬────────────┐      │
-    ││      │axis 1      │
-    │├──────┼────────────┤      │
-    ││axis 0│ 0.00  1.00 │      │
-    ││      │ 2.00  3.00 │      │
-    │└──────┴────────────┘      │
-    └───────────────────────────┘
-    |}];
+    {| [0]: r2x2_a shape 1:2->0:2  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ b;
[%expect
-    {|
-    ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
-    │[1]: r2x2x3x4_b shape 1:2,2:3,3:4->0:2                                                                                 │
-    │┌──────┬────────────────────────────────────┬────────────────────────────────────┬────────────────────────────────────┐│
-    ││      │0 @ 2                               │1 @ 2                               │2 @ 2                               ││
-    ││      │axis 3                              │axis 3                              │axis 3                              ││
-    │├──────┼────────────────────────────────────┼────────────────────────────────────┼────────────────────────────────────┤│
-    ││0 @ 1 │ 0.00     1.00     2.00     3.00    │ 4.00     5.00     6.00     7.00    │ 8.00     9.00     1.00e+1  1.10e+1 ││
-    ││axis 0│ 2.40e+1  2.50e+1  2.60e+1  2.70e+1 │ 2.80e+1  2.90e+1  3.00e+1  3.10e+1 │ 3.20e+1  3.30e+1  3.40e+1  3.50e+1 ││
-    │├──────┼────────────────────────────────────┼────────────────────────────────────┼────────────────────────────────────┤│
-    ││1 @ 1 │ 1.20e+1  1.30e+1  1.40e+1  1.50e+1 │ 1.60e+1  1.70e+1  1.80e+1  1.90e+1 │ 2.00e+1  2.10e+1  2.20e+1  2.30e+1 ││
-    ││axis 0│ 3.60e+1  3.70e+1  3.80e+1  3.90e+1 │ 4.00e+1  4.10e+1  4.20e+1  4.30e+1 │ 4.40e+1  4.50e+1  4.60e+1  4.70e+1 ││
-    │└──────┴────────────────────────────────────┴────────────────────────────────────┴────────────────────────────────────┘│
-    └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
-    |}];
+    {| [1]: r2x2x3x4_b shape 1:2,2:3,3:4->0:2  <virtual> |}];
Tensor.print ~with_code:false ~with_grad:false `Default @@ c;
[%expect
{|
"/usr/bin/env" "bash" "-c" "opam exec -- dune build @install @check @runtest && rm -rf _build" failed with exit status 1
2025-07-05 10:45.58: Job failed: Failed: Build failed