MTLTensorBinding

Trait MTLTensorBinding 

Source
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§

Source

fn tensorDataType(&self) -> MTLTensorDataType
where Self: Sized + Message,

Available on crate feature MTLTensor only.

The underlying data format of this tensor.

Source

fn indexType(&self) -> MTLDataType
where Self: Sized + Message,

Available on crate feature MTLDataType only.

The data format you use for indexing into the tensor.

Source

fn dimensions(&self) -> Option<Retained<MTLTensorExtents>>
where Self: Sized + Message,

Available on crate feature 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.

Trait Implementations§

Source§

impl ProtocolType for dyn MTLTensorBinding

Source§

const NAME: &'static str = "MTLTensorBinding"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn MTLTensorBinding

Implementations on Foreign Types§

Source§

impl<T> MTLTensorBinding for ProtocolObject<T>
where T: ?Sized + MTLTensorBinding,

Implementors§