Contents

dimensions

The array of sizes, in elements, one for each dimension of this tensor.

Declaration

var dimensions: MTLTensorExtents? { get }

Discussion

For shader-bound tensors with dynamic extents, the rank of dimensions corresponds to the rank the shader function specifies, and extentAtDimensionIndex: always returns a value of -1.

For machine learning pipelines, dimensions corresponds to the default shape, if you provide one. Otherwise, it’s nil in the case of an undefined shape.