Contents

init(_:shape:dataType:)

Initializes an tensor data with a metal buffer.

Declaration

init(_ buffer: any MTLBuffer, shape: [NSNumber], dataType: MPSDataType)

Parameters

  • buffer:

    MTLBuffer to be used within the MPSGraphTensorData

  • shape:

    Shape of the output tensor

  • dataType:

    dataType of the placeholder tensor

Return Value

A valid MPSGraphTensorData, or nil if allocation failure.

Discussion

The device of the MTLBuffer will be used to get the MPSDevice for this MPSGraphTensorData.