makeTensor(descriptor:attachments:)
Creates a tensor with the specified descriptor and per-plane buffer backing storage.
Declaration
func makeTensor(descriptor: MTLTensorDescriptor, attachments: MTLTensorBufferAttachments) throws -> any MTLTensorParameters
- descriptor:
The tensor descriptor configuring the data plane and auxiliary planes.
- attachments:
The per-plane buffer backing storage. Must not be
nil.
Return Value
A tensor, or nil if validation fails.
Discussion
This method validates the constraints documented on MTLTensorDescriptor and MTLTensorBufferAttachments, and additionally requires that every plane configured in descriptor (data plane and all auxiliary planes) has a corresponding entry in attachments.