vlogic
Description
Performs the element-wise logical AND/OR operation on two tensors or performs the element-wise logical NOT operation on a tensor.
Prototype
vlogic(lhs, rhs=None, operation='logic_and')
Parameters
- lhs: a tvm.tensor for the left tensor
- rhs: a tvm.tensor for the right tensor
- operation: operation type selected from logic_and, logic_or, or logic_not. Defaults to logic_and. To perform the logic_not operation, you must set rhs to None.
- The tensors must have the same data type of bool.
Returns
res_tensor: a tvm.tensor for the result tensor
Restrictions
None
Applicability
Example
from tbe import tvm from tbe import dsl shape = (1024,1024) input_dtype = "bool" data1 = tvm.placeholder(shape, name="data1", dtype=input_dtype) data2 = tvm.placeholder(shape, name="data2", dtype=input_dtype) res = dsl.vlogic(data1, data2, 'logic_and')
Parent topic: To-Be-Deprecated APIs