Skip to main content

ClikaRT::ops::unsqueeze

function

unsqueeze()

Tensor unsqueeze(Tensor x, int64_t dim)

Insert a size-1 dim at dim. The position is normalized against the OUTPUT rank, so -1 appends at the trailing end. Returns a view (no copy).

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when dim is outside the output's rank (code_name() carries the reason).

Returns: a view of x with rank + 1.

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