A tensor that exists

A library without a tensor is a README. Tensor starts as four fields and no memory: shape, strides, dtype, device_id. The first test builds one by hand — shape {2,3}, strides {3,1}, f32, CPU — and checks that the shape has two dimensions. Instantiation moves inside the test block so the lifetime is the block, not the file.

Icons land. A write-up for the culture goes in, which is the honest version of a homepage: here is why this exists, here is how early it is, here is the CUDA toolkit you will have to install. Then the type grows an allocator and a []u8 buffer. init counts elements from the shape, dupes caller bytes or allocates zeros. deinit frees the buffer. Shape and strides are still borrowed from the caller.

The last note of the day is that it should be failing tomorrow. The init does not try the allocator. The data is bytes, not a type. CPU and GPU are a tag, not two initializers. Tomorrow is the point.

bf17001 · 745b3d6 · 3a73e15 · c2e48ef · 5d29041

Previous · Next