pub struct TensorExtents(/* private fields */);Expand description
Extents (dimensions/strides) for a tensor.
C++ equivalent: MTL::TensorExtents
Implementations§
Source§impl TensorExtents
impl TensorExtents
Sourcepub fn new() -> Option<Self>
pub fn new() -> Option<Self>
Create a new tensor extents.
C++ equivalent: TensorExtents* alloc()->init()
Sourcepub fn with_values(values: &[Integer]) -> Option<Self>
pub fn with_values(values: &[Integer]) -> Option<Self>
Create a tensor extents with specific rank and values.
C++ equivalent: TensorExtents* alloc()->init(NS::UInteger, const NS::Integer*)
Sourcepub fn rank(&self) -> UInteger
pub fn rank(&self) -> UInteger
Get the rank (number of dimensions).
C++ equivalent: NS::UInteger rank() const
Sourcepub fn extent_at_dimension_index(&self, dimension_index: UInteger) -> Integer
pub fn extent_at_dimension_index(&self, dimension_index: UInteger) -> Integer
Get the extent at a specific dimension index.
C++ equivalent: NS::Integer extentAtDimensionIndex(NS::UInteger)
Trait Implementations§
Source§impl Clone for TensorExtents
impl Clone for TensorExtents
Source§impl Drop for TensorExtents
impl Drop for TensorExtents
Source§impl Referencing for TensorExtents
impl Referencing for TensorExtents
Source§fn as_mut_ptr(&self) -> *mut c_void
fn as_mut_ptr(&self) -> *mut c_void
Get the raw mutable pointer to the Objective-C object.
Source§fn retain(&self) -> Selfwhere
Self: Clone,
fn retain(&self) -> Selfwhere
Self: Clone,
Retain the object, incrementing its reference count. Read more
Source§fn autorelease(&self) -> Selfwhere
Self: Clone,
fn autorelease(&self) -> Selfwhere
Self: Clone,
Autorelease the object. Read more
Source§fn retain_count(&self) -> usize
fn retain_count(&self) -> usize
Get the retain count of the object. Read more
impl Send for TensorExtents
impl Sync for TensorExtents
Auto Trait Implementations§
impl Freeze for TensorExtents
impl RefUnwindSafe for TensorExtents
impl Unpin for TensorExtents
impl UnwindSafe for TensorExtents
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