pub fn tensor<T: IntoTensor>(data: T) -> T::Tensor
Expand description

Creates a tensor using the data based in. The return type is based on the data you pass in. See IntoTensor for implementations.

Examples:

let _/*: Tensor0D*/ = tensor(0.0);
let _/*: Tensor1D<3>*/ = tensor([0.0, 1.0, 2.0]);
let _/*: Tensor2D<2, 3>*/ = tensor([[0.0; 3]; 2]);