我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用tensorflow.logical_xor()。
def __xor__(self, other): return tf.logical_xor(self, other)
def __rxor__(self, other): return tf.logical_xor(other, self) # boolean operations
def setUp(self): super(LogicalBinaryOpsTest, self).setUp() self.ops = [ ('logical_and', operator.and_, tf.logical_and, core.logical_and), ('logical_or', operator.or_, tf.logical_or, core.logical_or), ('logical_xor', operator.xor, tf.logical_xor, core.logical_xor), ] self.test_lt_1 = self.original_lt < 10 self.test_lt_2 = self.original_lt < 5 self.test_lt_1_broadcast = self.test_lt_1.tensor self.test_lt_2_broadcast = self.test_lt_2.tensor self.broadcast_axes = self.test_lt_1.axes