def Xor(onnx_node, ng_inputs): # type: (NodeWrapper, List[NgraphNode]) -> NgraphNode """Perform the `xor` logical operation elementwise on two input tensors.""" left, right = get_bool_nodes( broadcast_for_binary_operation(onnx_node, ng_inputs)) return ng.logical_or(ng.logical_and(left, ng.logical_not(right)), ng.logical_and(ng.logical_not(left), right))
def Not(onnx_node, ng_inputs): # type: (NodeWrapper, List[NgraphNode]) -> NgraphNode """Return the negation of the input tensor elementwise.""" data = ng.convert(ng.not_equal(ng_inputs[0], 0), bool) return ng.logical_not(data)