Skip to main content

ClikaRT::ops::tensordot

function

tensordot()

Tensor tensordot(
    Tensor a,
    Tensor b,
    ClikaRT::Span<const std::int64_t> dims_a,
    ClikaRT::Span<const std::int64_t> dims_b
)

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.

Declared in ClikaRT/compute/ops.h, line 2886