This document is relevant for: Trn1, Trn2, Trn3

nki.language.copy#

nki.language.copy(x, dtype=None)[source]#

Create a copy of the input tile.

Warning

This API is experimental and may change in future releases.

Uses the Scalar Engine via activation(op=copy). Note that the Scalar Engine internally casts through FP32, which may be lossy for integer types with values exceeding FP32 precision (e.g. int32 values > 2^23).

Parameters:
  • x – the source of copy, must be a tile in SBUF or PSUM.

  • dtype – (optional) data type to cast the output type to (see Supported Data Types for more information); if not specified, it will default to be the same as the data type of the input tile.

Returns:

a new tile with the same layout as x, allocated on the same buffer as x (SBUF or PSUM).

This document is relevant for: Trn1, Trn2, Trn3