nki.isa.scalar_tensor_tensor#
- nki.isa.scalar_tensor_tensor(*, data, op0, operand0, op1, operand1, reverse0=False, reverse1=False, dtype=None, mask=None, **kwargs)[source]#
- Apply up to two math operators using Vector Engine: - (data <op0> operand0) <op1> operand1.- datainput can be an SBUF or PSUM tile of 2D shape.- operand0can be SBUF or PSUM tile of shape- (data.shape[0], 1), i.e., vector, or a compile-time constant scalar.- operand1can be SBUF or PSUM tile of shape- (data.shape[0], data.shape[1])(i.e., has to match- datashape), note that- operand1and- datacan’t both be on PSUM.- Estimated instruction cost: - Cost (Vector Engine Cycles) - Condition - N- dataand- operand1are both- bfloat16,- op0=nl.subtractand- op1=nl.multiply, and- Nis even- 2*N- otherwise - where, - Nis the number of elements per partition in- data.
 - Parameters:
- data – the input tile 
- op0 – the first math operator used with operand0 (see Supported Math Operators for NKI ISA for supported operators) 
- operand0 – a scalar constant or a tile of shape - (data.shape[0], 1), where data.shape[0] is the partition axis size of the input- datatile.
- reverse0 – reverse ordering of inputs to - op0; if false,- operand0is the rhs of- op0; if true,- operand0is the lhs of- op0.
- op1 – the second math operator used with operand1 (see Supported Math Operators for NKI ISA for supported operators). 
- operand1 – a tile of shape with the same partition and free dimension as - datainput.
- reverse1 – reverse ordering of inputs to - op1; if false,- operand1is the rhs of- op1; if true,- operand1is the lhs of- op1.
- 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:
- an output tile of - (data <op0> operand0) <op1> operand1computation
 
