Skip to main content

ClikaRT::ops::reshape_as

function

reshape_as()

Tensor reshape_as(Tensor x, Tensor other)

Reshape x to other's shape (other supplies extents only; its data is never read). The element counts must match.

Returns a view sharing storage when x's stride layout can express the new shape; copies into a fresh dense tensor otherwise.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when the element counts differ (code_name() carries the reason).

Returns: the reshaped tensor, a view when the layout permits.

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