<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/pointwiseMax(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "s:6CoreML12pointwiseMaxyAA8MLTensorVAD_ADtF::OverloadGroup"
  },
  "title" : "pointwiseMax(_:_:)"
}
-->

# pointwiseMax(_:_:)

Computes the element-wise minimum between two tensors.

```
func pointwiseMax(_ lhs: MLTensor, _ rhs: MLTensor) -> MLTensor
```

## Discussion

For example:

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

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)