Contents

minimumWithNaNPropagation(_:_:name:)

Returns the elementwise minimum of the input tensors, while propagating NaN values.

Declaration

func minimumWithNaNPropagation(_ primaryTensor: MPSGraphTensor, _ secondaryTensor: MPSGraphTensor, name: String?) -> MPSGraphTensor

Parameters

  • primaryTensor:

    The LHS tensor of the binary Op.

  • secondaryTensor:

    The RHS tensor of the binary Op.

  • name:

    An optional string which serves as an identifier for the operation.

Return Value

A valid MPSGraphTensor object containing the elementwise result of the applied operation.

Discussion

This operation creates a minimum with NaN propagation operation and returns the result tensor. This means that if any of the elementwise operands is NaN, the result is NaN. It supports broadcasting as well.

resultTensor = isNaN(primaryTensor) || isNan(secondaryTensor) ? NaN : min(primaryTensor, secondaryTensor)