pub struct DenseI32Tensor { /* private fields */ }Expand description
Dense tensor backed by Vec<i32> storage.
Integer tensors do NOT participate in autograd (requires_grad is always false).
Implementations§
Source§impl DenseI32Tensor
impl DenseI32Tensor
pub fn from_storage( meta: TensorMeta, storage: Vec<i32>, ) -> Result<Self, DenseTensorError>
pub fn from_contiguous_values( values: Vec<i32>, shape: Vec<usize>, device: Device, ) -> Result<Self, DenseTensorError>
pub fn id(&self) -> u64
pub fn storage_id(&self) -> u64
pub fn meta(&self) -> &TensorMeta
pub fn storage(&self) -> &[i32]
Sourcepub fn contiguous_values(&self) -> Result<&[i32], DenseTensorError>
pub fn contiguous_values(&self) -> Result<&[i32], DenseTensorError>
Return the contiguous values slice.
pub fn version(&self) -> u64
Trait Implementations§
Source§impl Clone for DenseI32Tensor
impl Clone for DenseI32Tensor
Source§fn clone(&self) -> DenseI32Tensor
fn clone(&self) -> DenseI32Tensor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DenseI32Tensor
impl Debug for DenseI32Tensor
impl Eq for DenseI32Tensor
Source§impl PartialEq for DenseI32Tensor
impl PartialEq for DenseI32Tensor
impl StructuralPartialEq for DenseI32Tensor
Auto Trait Implementations§
impl Freeze for DenseI32Tensor
impl RefUnwindSafe for DenseI32Tensor
impl Send for DenseI32Tensor
impl Sync for DenseI32Tensor
impl Unpin for DenseI32Tensor
impl UnsafeUnpin for DenseI32Tensor
impl UnwindSafe for DenseI32Tensor
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