---
title: "ClikaRT::ops::bitwise_and"
sidebar_label: "bitwise_and"
description: "Elementwise bitwise AND; the dtype law the whole bitwise family shares: integer and Bool dtypes only, and BOTH operands must carry ONE dtype (no promotion; a mixed pair is refused typed; a scalar othe…"
---

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

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

## bitwise\_and() {#bitwise_and}

<div class="api-signature">

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

</div>

Elementwise bitwise AND; the dtype law the whole bitwise family shares: integer and Bool dtypes only, and BOTH operands must carry ONE dtype (no promotion; a mixed pair is refused typed; a scalar `other` adopts `input`'s dtype). Shapes broadcast per the standard rules; the output carries the shared dtype. The other bitwise ops state "dtype law as \`bitwise_and\`" instead of restating this.

**Returns:** the broadcast-shaped AND at the operands' shared dtype.

**Throws**

- `ClikaRT::Error`: (`INVALID_ARGUMENT`) when the operand dtypes differ, for a floating-point operand, or broadcast-incompatible shapes.

  ```cpp
  auto masked = ClikaRT::ops::bitwise_and(flags, 0x0F);
  ```

<div class="api-declared">

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

</div>
