---
title: "ClikaRT::ops::shape_host"
sidebar_label: "shape_host"
description: "The shape of input as a HOST-resident Int64 tensor, written from metadata: no device kernel, no readback, no stream synchronize, whatever device input lives on."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

3 overloads.

## shape\_host(Tensor) {#shape_host}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`shape_host`**([`Tensor`](../Tensor.md) `input`)

</div>

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

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 5461

</div>

## shape\_host(Tensor, int64\_t) {#shape_host-2}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`shape_host`**([`Tensor`](../Tensor.md) `input`, `std::int64_t` `dim`)

</div>

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)`.

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 5464

</div>

## shape\_host(Tensor, optional\<int64\_t\>, optional\<int64\_t\>) {#shape_host-3}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`shape_host`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `input`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::optional<std::int64_t>` `start`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::optional<std::int64_t>` `end`<br />
)

</div>

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.

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 5467

</div>
