Contents

pointwiseMin(_:_:)

Computes the element-wise minimum of two tensors.

Declaration

func pointwiseMin(_ lhs: MLTensor, _ rhs: MLTensor) -> MLTensor

Discussion

For example:

let x = MLTensor([1.0, 3.0, 6.0])
let y = MLTensor([6.0, 3.0, 1.0])
let z = pointwiseMin(x, y)
await z.shapedArray(of: Float.self) // is [1.0, 3.0, 1.0]

Shapes must be broadcastable, where the broadcasted shape becomes the shape of the output.

See Also

Model tensor