pub struct Tensor { /* private fields */ }
Implementations
Right most is the continous indexing, This method convert continuous index to index along each dimension.
Right most is the continous indexing, This method convert index along each dimension to continuous index.
Create a tensor from a Vec,
let t1 = Tensor::from_vec_f32(&vec![0., 1., 2., 4.,], &vec![2,2]);
return the internal buffer May fail if the underlying data is f64
return the internal buffer May fail if the underlying data is f32
Returns a tensor of size size filled with fill_value.
Returns a new tensor with a dimension of size one inserted at the specified position.
The returned tensor shares the same underlying data with this tensor.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Tensor
impl !UnwindSafe for Tensor
Blanket Implementations
Mutably borrows from an owned value. Read more