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

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

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

# TensorCallback

[common]\
fun interface [TensorCallback](index.md)

A callback carrying a tensor: [Tensor.onComplete](../Tensor/onComplete.md)'s notification. The [Tensor](../Tensor/index.md) handed in is the callback's for the duration of the call only: whatever reference it does not [Tensor.release](../Tensor/release.md) itself is released when the callback returns. A callback that needs the value past its return reads it out ([Tensor.item](../Tensor/item.md), the array readers) inside the call.

Fires on the runtime's callback pool, never the registering thread; keep the body short and never block in it.

## Functions

| Name | Summary |
|---|---|
| [run](run.md) | [common]<br>abstract fun [run](run.md)(t: [Tensor](../Tensor/index.md)) |