pub unsafe trait MTLTensorBinding: MTLBinding {
// Provided methods
fn tensorDataType(&self) -> MTLTensorDataType
where Self: Sized + Message { ... }
fn indexType(&self) -> MTLDataType
where Self: Sized + Message { ... }
fn dimensions(&self) -> Option<Retained<MTLTensorExtents>>
where Self: Sized + Message { ... }
}Available on crate feature
MTLArgument only.Expand description
An object that represents a tensor bound to a graphics or compute function or a machine learning function.
See also Apple’s documentation
Provided Methods§
Sourcefn tensorDataType(&self) -> MTLTensorDataType
Available on crate feature MTLTensor only.
fn tensorDataType(&self) -> MTLTensorDataType
MTLTensor only.The underlying data format of this tensor.
Sourcefn indexType(&self) -> MTLDataType
Available on crate feature MTLDataType only.
fn indexType(&self) -> MTLDataType
MTLDataType only.The data format you use for indexing into the tensor.
Sourcefn dimensions(&self) -> Option<Retained<MTLTensorExtents>>
Available on crate feature MTLTensor only.
fn dimensions(&self) -> Option<Retained<MTLTensorExtents>>
MTLTensor only.The array of sizes, in elements, one for each dimension of this tensor.
Because shader-bound tensors have dynamic extents, if this tensor is shader bound, the MTLTensorExtents/rank of dimensions corresponds to the rank the shader function specifies, and MTLTensorExtents/extentsAtDimensionIndex: always returns a value of -1.
In the case of functions used with machine learning pipelines, dimensions corresponds to the default shape, if you provide one. Otherwise, it’s nil in the case of an undefined shape.