<!--
{
  "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/MLTensor/._(_:_:)-8il7w",
  "metadataVersion" : "0.1.0",
  "role" : "Operator",
  "symbol" : {
    "kind" : "Operator",
    "modules" : [
      "Core ML",
      "CoreML"
    ],
    "preciseIdentifier" : "s:6CoreML8MLTensorV2zxoiyA2C_ACtFZ"
  },
  "title" : ".^(_:_:)"
}
-->

# .^(_:_:)

Computes element-wise logical XOR where both operands are expected contain Boolean scalar elements.

```
static func .^ (lhs: MLTensor, rhs: MLTensor) -> MLTensor
```

## Discussion

For example:

```swift
let x = MLTensor([true, true, true])
let y = MLTensor([true, false, true])
x .^ y // is [false, true, false]
```

---

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)