Skip to main content

ClikaRT::ops::shape_host

function

3 overloads.

shape_host(Tensor)

Tensor shape_host(Tensor x)

The shape of x as a HOST-resident Int64 tensor, written from metadata: no device kernel, no readback, no stream synchronize, whatever device x lives on. The cheap way to feed shape values to shape-consuming arguments (a reshape dim) instead of Tensor::shape()'s concrete ints.

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

shape_host(Tensor, int64_t)

Tensor shape_host(Tensor x, std::int64_t dim)

One dim of the shape as a 0-D Int64 host tensor (negative dim counts from the end). Same no-sync contract as shape_host(x).

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

shape_host(Tensor, optional<int64_t>, optional<int64_t>)

Tensor shape_host(
    Tensor x,
    std::optional<std::int64_t> start,
    std::optional<std::int64_t> end
)

The [start, end) window of the shape (Python-slice semantics: negatives count from the end, absent bounds are open) as a 1-D Int64 host tensor.

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