# tensorflow::ops::BatchMatMul Class Reference

# tensorflow::ops::BatchMatMul

`#include <math_ops.h>`

Multiplies slices of two tensors in batches.

## Summary

Multiplies all slices of `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor``x` and `y` (each slice can be viewed as an element of a batch), and arranges the individual results in a single output tensor of the same batch size. Each of the individual slices can optionally be adjointed (to adjoint a matrix means to transpose and conjugate it) before multiplication by setting the `adj_x` or `adj_y` flag to `True`, which are by default `False`.

The input tensors `x` and `y` are 2-D or higher with shape `[..., r_x, c_x]` and `[..., r_y, c_y]`.

The output tensor is 2-D or higher with shape `[..., r_o, c_o]`, where:

```
r_o = c_x if adj_x else r_x
c_o = r_y if adj_y else c_y
```

<br />

It is computed as:

```
output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])
```

<br />

Arguments:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- x: 2-D or higher with shape `[..., r_x, c_x]`.
- y: 2-D or higher with shape `[..., r_y, c_y]`.

<br />

Optional attributes (see `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/batch-mat-mul/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs`):

- adj_x: If `True`, adjoint the slices of `x`. Defaults to `False`.
- adj_y: If `True`, adjoint the slices of `y`. Defaults to `False`.

<br />

Returns:

- `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output`: 3-D or higher with shape `[..., r_o, c_o]`

<br />

| ### Constructors and Destructors ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul_1a951cabca8c8dbcf8b746969d80f2b480(const ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input x, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input y)` ||
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul_1aec4aecf952592bd193eca45a9900ebe1(const ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input x, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input y, const https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/batch-mat-mul/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs & attrs)` ||

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul_1a255c486fdefe3708a3355e3f85e8daf2` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul_1ad3a290bbf8589298ccf6cd5bf0018a53` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |

| ### Public functions ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul_1af21f279f44b701fb277af586e5f0dd69() const ` | `::tensorflow::Node *` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul_1aa6685ef6076abe41dc6d4f97156d77cb() const ` | ` `` ` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul_1a7d6d385af7d73a390e36ccc7e6989345() const ` | ` `` ` |

| ### Public static functions ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul_1a47c8466020881eced6720f2f415053dd(bool x)` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/batch-mat-mul/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul_1a3f939eb8aea098cdf431a3b626274e6b(bool x)` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/batch-mat-mul/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs` |

| ### Structs ||
|---|---|
| [tensorflow::ops::BatchMatMul::Attrs](https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/batch-mat-mul/attrs) | Optional attribute setters for [BatchMatMul](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul). |

## Public attributes

### operation

```
Operation operation
```

### output

```
::tensorflow::Output output
```

## Public functions

### BatchMatMul

```
 BatchMatMul(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input x,
  ::tensorflow::Input y
)
```

### BatchMatMul

```
 BatchMatMul(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input x,
  ::tensorflow::Input y,
  const BatchMatMul::Attrs & attrs
)
```

### node

```
::tensorflow::Node * node() const 
```

### operator::tensorflow::Input

```
 operator::tensorflow::Input() const 
```

### operator::tensorflow::Output

```
 operator::tensorflow::Output() const 
```

## Public static functions

### AdjX

```
Attrs AdjX(
  bool x
)
```

### AdjY

```
Attrs AdjY(
  bool x
)
```