---
title: "ClikaRT::ops::eq"
sidebar_label: "eq"
description: "Elementwise equality a == other, the output contract the whole comparison family shares: the result is a Bool tensor at the broadcast shape (operands promote to their dominant dtype before the compare…"
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

## eq() {#eq}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`eq`**([`Tensor`](../Tensor.md) `input`, [`ScalarOrTensor`](../ScalarOrTensor.md) `other`)

</div>

Elementwise equality `a == other`, the output contract the whole comparison family shares: the result is a `Bool` tensor at the broadcast shape (operands promote to their dominant dtype before the compare). A scalar `other` compares against every element. The other comparisons state "output as \`eq\`" instead of restating this.

**Returns:** the broadcast-shaped `Bool` mask.

**Throws**

- `ClikaRT::Error`: (`INVALID_ARGUMENT`) when the operand shapes are not broadcast-compatible.

  ```cpp
  auto hits = ClikaRT::ops::eq(ids, pad_id);  // Bool mask
  ```

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 1720

</div>
