pub struct Tensor {
pub name: String,
pub shape: Vec<usize>,
pub data: TensorBuffer,
}Expand description
Owned, named tensor with contiguous, row-major CPU storage.
Fields§
§name: StringInput or output name from the ONNX graph.
shape: Vec<usize>Concrete dimensions; an empty shape denotes a scalar.
data: TensorBufferOwned elements in row-major order.
Implementations§
Source§impl Tensor
impl Tensor
Sourcepub fn view(&self) -> TensorView<'_>
pub fn view(&self) -> TensorView<'_>
Borrow the tensor without copying its metadata or elements.
Sourcepub fn view_mut(&mut self) -> TensorViewMut<'_>
pub fn view_mut(&mut self) -> TensorViewMut<'_>
Borrow the tensor for element mutation without copying.
Trait Implementations§
impl StructuralPartialEq for Tensor
Auto Trait Implementations§
impl Freeze for Tensor
impl RefUnwindSafe for Tensor
impl Send for Tensor
impl Sync for Tensor
impl Unpin for Tensor
impl UnsafeUnpin for Tensor
impl UnwindSafe for Tensor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more