pub const TENSOR: FunctionDescriptor;Expand description
Constructs packed numeric data with explicit dimensions.
T is a numeric dtype. Values are row-major and their count must equal the checked product of the dimensions. Invalid shapes return Err(DataError). Host byte and execution limits reject execution before allocation.
§Signature
func tensor[T](values: List[T], dimensions: List[Number]) -> Res[Tensor[T], DataError]§Constructs packed numeric data with explicit dimensions
Run the example, then change the data and inspect the result.
let samples = tensor[f32]([1, 2, 3, 4], [2, 2])?;
print(samples[1, 0]?);