---
title: "ClikaRT::ops::tensordot"
sidebar_label: "tensordot"
description: "Named-axis contraction: sums a over dims_a against b over dims_b, pairwise. dims_a[i] on a contracts with dims_b[i] on b (equal list lengths; per-pair sizes must agree)."
---

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

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

## tensordot() {#tensordot}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`tensordot`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `a`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `b`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`ClikaRT::Span`](../Span.md)`<const std::int64_t>` `dims_a`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`ClikaRT::Span`](../Span.md)`<const std::int64_t>` `dims_b`<br />
)

</div>

Named-axis contraction: sums `a` over `dims_a` against `b` over `dims_b`, pairwise.

`dims_a[i]` on `a` contracts with `dims_b[i]` on `b` (equal list lengths; per-pair sizes must agree). The output is `a`'s non-contracted dims followed by `b`'s.

**Parameters**

- `a`: left operand.
- `b`: right operand.
- `dims_a`: contraction axes on `a`.
- `dims_b`: contraction axes on `b`, aligned with `dims_a`.

**Returns:** the contracted tensor.

**Throws**

- `ClikaRT::Error`: (`INVALID_ARGUMENT`) when the axis lists differ in length or a paired extent disagrees.

<div class="api-declared">

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

</div>
