Skip to main content

//clika-runtime/io.clika.runtime/Tensor/onComplete

onComplete

[common]
fun onComplete(callback: TensorCallback)

Register callback to run once this tensor's producer has finished (a tensor that is already available fires it right away). The Tensor handed to the callback is its own for the call: whatever it does not release itself is released when the callback returns.

val latch = CountDownLatch(1)
x.onComplete { result -> println(result.summary()); latch.countDown() }
latch.await()