dimensions
The array of sizes, in elements, one for each dimension of this tensor.
Declaration
var dimensions: MTLTensorExtents? { get }Discussion
Because shader-bound tensors have dynamic extents, if this tensor is shader bound, the 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.