Nx.Tensor defines the struct that is returned by Nx.tensor. I think I want @type to be a way to create an equivalent to rust’s Enums or custom types in elm, but it’s just not that kind of tool.
The main restriction is that while you can write types that take arguments, they can’t do arithmetic or pattern-match and live in a separate namespace from plain functions.
On that note, there’s no Nx.tensor@type - the closest thing is Nx.Tensor.t, but that uses the argument to specify the backend type not the shape.