pub struct TensorDescriptor(/* private fields */);Expand description
Descriptor for creating a tensor.
C++ equivalent: MTL::TensorDescriptor
Implementations§
Source§impl TensorDescriptor
impl TensorDescriptor
Sourcepub fn new() -> Option<Self>
pub fn new() -> Option<Self>
Create a new tensor descriptor.
C++ equivalent: TensorDescriptor* alloc()->init()
Sourcepub fn data_type(&self) -> TensorDataType
pub fn data_type(&self) -> TensorDataType
Get the data type.
C++ equivalent: TensorDataType dataType() const
Sourcepub fn set_data_type(&self, data_type: TensorDataType)
pub fn set_data_type(&self, data_type: TensorDataType)
Set the data type.
C++ equivalent: void setDataType(MTL::TensorDataType)
Sourcepub fn dimensions(&self) -> Option<TensorExtents>
pub fn dimensions(&self) -> Option<TensorExtents>
Get the dimensions.
C++ equivalent: TensorExtents* dimensions() const
Sourcepub fn set_dimensions(&self, dimensions: &TensorExtents)
pub fn set_dimensions(&self, dimensions: &TensorExtents)
Set the dimensions.
C++ equivalent: void setDimensions(const MTL::TensorExtents*)
Sourcepub fn strides(&self) -> Option<TensorExtents>
pub fn strides(&self) -> Option<TensorExtents>
Get the strides.
C++ equivalent: TensorExtents* strides() const
Sourcepub fn set_strides(&self, strides: &TensorExtents)
pub fn set_strides(&self, strides: &TensorExtents)
Set the strides.
C++ equivalent: void setStrides(const MTL::TensorExtents*)
Sourcepub fn storage_mode(&self) -> StorageMode
pub fn storage_mode(&self) -> StorageMode
Get the storage mode.
C++ equivalent: StorageMode storageMode() const
Sourcepub fn set_storage_mode(&self, storage_mode: StorageMode)
pub fn set_storage_mode(&self, storage_mode: StorageMode)
Set the storage mode.
C++ equivalent: void setStorageMode(MTL::StorageMode)
Sourcepub fn cpu_cache_mode(&self) -> CPUCacheMode
pub fn cpu_cache_mode(&self) -> CPUCacheMode
Get the CPU cache mode.
C++ equivalent: CPUCacheMode cpuCacheMode() const
Sourcepub fn set_cpu_cache_mode(&self, cpu_cache_mode: CPUCacheMode)
pub fn set_cpu_cache_mode(&self, cpu_cache_mode: CPUCacheMode)
Set the CPU cache mode.
C++ equivalent: void setCpuCacheMode(MTL::CPUCacheMode)
Sourcepub fn hazard_tracking_mode(&self) -> HazardTrackingMode
pub fn hazard_tracking_mode(&self) -> HazardTrackingMode
Get the hazard tracking mode.
C++ equivalent: HazardTrackingMode hazardTrackingMode() const
Sourcepub fn set_hazard_tracking_mode(&self, hazard_tracking_mode: HazardTrackingMode)
pub fn set_hazard_tracking_mode(&self, hazard_tracking_mode: HazardTrackingMode)
Set the hazard tracking mode.
C++ equivalent: void setHazardTrackingMode(MTL::HazardTrackingMode)
Sourcepub fn resource_options(&self) -> ResourceOptions
pub fn resource_options(&self) -> ResourceOptions
Get the resource options.
C++ equivalent: ResourceOptions resourceOptions() const
Sourcepub fn set_resource_options(&self, resource_options: ResourceOptions)
pub fn set_resource_options(&self, resource_options: ResourceOptions)
Set the resource options.
C++ equivalent: void setResourceOptions(MTL::ResourceOptions)
Sourcepub fn usage(&self) -> TensorUsage
pub fn usage(&self) -> TensorUsage
Get the usage.
C++ equivalent: TensorUsage usage() const
Sourcepub fn set_usage(&self, usage: TensorUsage)
pub fn set_usage(&self, usage: TensorUsage)
Set the usage.
C++ equivalent: void setUsage(MTL::TensorUsage)