pub struct TensorDescriptor { /* private fields */ }Implementations§
Source§impl TensorDescriptor
impl TensorDescriptor
pub fn create_for<T: DataTypeLike>( context: &Context, shape: &[u64], devices: &[TensorDevice], ) -> Result<Self>
pub fn create( context: &Context, config: TensorDescriptorConfig<'_>, ) -> Result<Self>
Sourcepub unsafe fn from_raw(
handle: cutensorMgTensorDescriptor_t,
context: &Context,
config: TensorDescriptorConfig<'_>,
) -> Result<Self>
pub unsafe fn from_raw( handle: cutensorMgTensorDescriptor_t, context: &Context, config: TensorDescriptorConfig<'_>, ) -> Result<Self>
Wraps an existing cuTENSORMg tensor descriptor.
§Safety
handle must be a valid cuTENSORMg tensor descriptor associated with
context. The metadata in config must describe the raw descriptor.
The returned value takes ownership of handle and destroys it on drop.
pub fn rank(&self) -> u32
pub fn shape(&self) -> &[u64]
pub fn element_stride(&self) -> Option<&[u64]>
pub fn block_size(&self) -> Option<&[u64]>
pub fn block_stride(&self) -> Option<&[u64]>
pub fn device_count(&self) -> Option<&[i32]>
pub fn devices(&self) -> &[TensorDevice]
pub fn data_type(&self) -> DataType
pub const fn as_raw(&self) -> cutensorMgTensorDescriptor_t
Sourcepub fn into_raw(self) -> cutensorMgTensorDescriptor_t
pub fn into_raw(self) -> cutensorMgTensorDescriptor_t
Consumes this descriptor and returns the owned raw cuTENSORMg tensor descriptor.
The caller becomes responsible for destroying the descriptor.
Trait Implementations§
Source§impl Debug for TensorDescriptor
impl Debug for TensorDescriptor
Source§impl Drop for TensorDescriptor
impl Drop for TensorDescriptor
Auto Trait Implementations§
impl !Send for TensorDescriptor
impl !Sync for TensorDescriptor
impl Freeze for TensorDescriptor
impl RefUnwindSafe for TensorDescriptor
impl Unpin for TensorDescriptor
impl UnsafeUnpin for TensorDescriptor
impl UnwindSafe for TensorDescriptor
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