4 ms·
Interesting that it "Supports tensors of up to 6 dimensions". Is it difficult to support an arbitrary number of dimensions, e.g. does Nim lack variadic generics
by logicchains 3y ago
Interesting that it "Supports tensors of up to 6 dimensions". Is it difficult to support an arbitrary number of dimensions, e.g. does Nim lack variadic generics?
- ElegantBeef 3y agoIt does not formally have variadics, but since it has tuples you can have pretend variadic generics.
- mratsim 3y agoAuthor here, Nim supports variadic generic, it's an arbitrary limitation so that shape and stride small vectors that describe a tebsor can be stack-allocated and fit in a cacheline. Also at the time, Nim default heap allocator was not compatible with OpenMP. Edit: it can be configured via a compile-time flag to 8 or 10 or anything: https://github.com/mratsim/Arraymancer/blob/master/src%2Farraymancer%2Flaser%2Fdynamic_stack_arrays.nim#L6 https://github.com/mratsim/Arraymancer/blob/master/src%2Farr...
- jononor 3y ago6 dimensions is sufficient for a dataset of 3d hyperspectral video (batch, time, x, y, z, channels). I think it wil cover the vast majority of usecases :D
- mratsim 3y agoThat was my reasoning for this "restriction".
- lucidrains 3y agoI've never worked with a project with more than 7 dimensions, yet
- mratsim 3y agoWhat would be the 7 dimensions?
- deleted 3y ago[deleted]