This document is relevant for: Trn2, Trn3

nki.language.empty_like#

nki.language.empty_like(x, dtype=None, buffer=None, name='')[source]#

Create a new tensor with the same shape and type as a given tensor.

((Similar to numpy.empty_like))

Warning

This API is experimental and may change in future releases.

Parameters:
  • x – the tensor.

  • dtype – the data type of the tensor (default: same as x).

  • buffer – the specific buffer (ie, sbuf, psum, hbm), (default: same as x).

  • name – the name of the tensor, used in scheduling.

Returns:

a new NkiTensor with the same shape and type as x.

This document is relevant for: Trn2, Trn3