This document is relevant for: Trn2, Trn3
nki.language.zeros#
- nki.language.zeros(shape, dtype, buffer=MemoryRegion.sbuf, name='')[source]#
Create a new tensor of given shape and dtype on the specified buffer, filled with zeros.
((Similar to numpy.zeros))
Warning
This API is experimental and may change in future releases.
- Parameters:
shape – the shape of the tensor.
dtype – the data type of the tensor.
buffer – the specific buffer (ie, sbuf, psum, hbm), defaults to sbuf.
name – the name of the tensor, used in scheduling.
- Returns:
a new
NkiTensorallocated on the buffer.
This document is relevant for: Trn2, Trn3