Contents

cast(_:to:name:)

Creates a cast operation and returns the result tensor.

Declaration

func cast(_ tensor: MPSGraphTensor, to type: MPSDataType, name: String?) -> MPSGraphTensor

Parameters

  • tensor:

    The input tensor.

  • type:

    The datatype to which MPSGraph casts the input.

  • name:

    The name for the operation.

Return Value

A valid MPSGraphTensor object.

Discussion

Returns the input tensor casted to the specied data type.