Tensor functions

Build, read, and reshape shape-carrying arrays.

FunctionDescription
[tensor(data: [number], shape: [usize]) → tensor<T>](functionfntensor)Build a tensor from flat row-major data and a shape; the data length must equal the product of the dimensions.
[tensor_data(t: tensor<T>) → [T]](functionfntensor_data)The flat row-major element data of a tensor as a list.
[tensor_reshape(t: tensor<T>, shape: [usize]) → tensor<T>](functionfntensor_reshape)Reinterpret a tensor's data under a new shape; the element count must be unchanged.
[tensor_shape(t: tensor<T>) → [usize]](functionfntensor_shape)The dimension sizes of a tensor as a list.