---
title: "shapeHost"
sidebar_label: "shapeHost"
description: "Kotlin binding reference: shapeHost."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[shapeHost](shapeHost.md)

# shapeHost

[common]\
fun [shapeHost](shapeHost.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)

`shapeHost(input: Tensor)`: the `shape_host` operator. 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` dim) instead of `Tensor::shape()`'s concrete ints.

[common]\
fun [shapeHost](shapeHost.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [Tensor](../Tensor/index.md)

`shapeHost(input: Tensor, dim: Long)`: the `shape_host` operator. 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)`.

[common]\
fun [shapeHost](shapeHost.md)(input: [Tensor](../Tensor/index.md), start: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?, end: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?): [Tensor](../Tensor/index.md)

`shapeHost(input: Tensor, start: Long?, end: Long?)`: the `shape_host` operator. 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.