Contents

dimensions

An array of sizes, in elements, one for each dimension of the tensors you create with this descriptor.

Declaration

@NSCopying var dimensions: MTLTensorExtents { get set }

Discussion

Every element of the array needs to be greater than 0.

When dataType is MTLTensorDataType.int2, MTLTensorDataType.uint2, MTLTensorDataType.int4, MTLTensorDataType.uint4, MTLTensorDataType.metalFloat4e2m1, MTLTensorDataType.metalFloat8e4m3, MTLTensorDataType.metalFloat8e5m2, or MTLTensorDataType.metalFloat8ue8m0:

  • The dimension value of the array’s first element needs to be a multiple of 32 elements.

  • The extents needs to have at least one dimension.

If the tensor has auxiliary planes, each dimension needs to be evenly divisible by its corresponding block factor.

The default value of this property is a rank one extents with size one.