This document is relevant for: Inf2, Trn1, Trn2

nki.language.invert#

nki.language.invert(x, *, dtype=None, mask=None, **kwargs)[source]#

Bitwise NOT of the input, element-wise.

((Similar to numpy.invert))

Computes the bit-wise NOT of the underlying binary representation of the integers in the input tile. This ufunc implements the C/Python operator ~

Parameters:
  • x – a tile.

  • 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.

  • mask – (optional) a compile-time constant predicate that controls whether/how this instruction is executed (see NKI API Masking for details)

Returns:

a tile with bitwise NOT x element-wise.

This document is relevant for: Inf2, Trn1, Trn2