This document is relevant for: Inf2
, Trn1
, Trn2
nki.language.mod#
- nki.language.mod(x, y, dtype=None, mask=None, **kwargs)[source]#
Integer Mod of
x / y
, element-wiseComputes the remainder complementary to the floor_divide function. It is equivalent to the Python modulus x % y and has the same sign as the divisor y.
((Similar to numpy.mod))
- Parameters:
x – a tile. If x is a scalar value it will be broadcast to the shape of y.
x.shape
andy.shape
must be broadcastable to a common shape, that will become the shape of the output.y – a tile or a scalar value.
x.shape
andy.shape
must be broadcastable to a common shape, that will become the shape of the output.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 tiles, or whichever input type has the highest precision (see NKI Type Promotion for more information);
mask – (optional) a compile-time constant predicate that controls whether/how this instruction is executed (see NKI API Masking for details)
- Returns:
a tile that has values
x mod y
.
This document is relevant for: Inf2
, Trn1
, Trn2