This document is relevant for: Inf2, Trn1, Trn1n

nki.language.zeros_like#

nki.language.zeros_like(a, dtype=None, buffer=None, name='', **kwargs)[source]#

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

((Similar to numpy.zeros_like))

Parameters:
  • a – the tensor.

  • dtype – the data type of the tensor (see Supported Data Types for more information).

  • buffer – the specific buffer (ie, sbuf, psum, hbm), defaults to sbuf.

  • name – the name of the tensor.

Returns:

a tensor of zeros with the same shape and type as a given tensor.

This document is relevant for: Inf2, Trn1, Trn1n