Skip to main content

ClikaRT::ops::cross

function

cross()

Tensor cross(
    Tensor a,
    Tensor b,
    std::optional<int64_t> dim = std::nullopt
)

3-vector cross product along dim.

Both operands share one shape; the dim axis (default: the LAST axis) must have size 3. The output mirrors the input shape.

Parameters

  • a: left operand.
  • b: right operand, same shape as a.
  • dim: the size-3 axis; absent = the last axis.

Returns: the element-wise cross products, shaped like the inputs.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when the shapes disagree or the chosen axis is not size 3.

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