def test_comparison_operators(self): t = self.t t += 3.45 a = t < 3.45 self.assertEqual(tensor.to_numpy(a)[0, 0], 0) a = t <= 3.45 self.assertEqual(tensor.to_numpy(a)[0, 0], 1) a = t > 3.45 self.assertEqual(tensor.to_numpy(a)[0, 0], 0) a = t >= 3.45 self.assertEqual(tensor.to_numpy(a)[0, 0], 1) a = tensor.lt(t, 3.45) self.assertEqual(tensor.to_numpy(a)[0, 0], 0) a = tensor.le(t, 3.45) self.assertEqual(tensor.to_numpy(a)[0, 0], 1) a = tensor.gt(t, 3.45) self.assertEqual(tensor.to_numpy(a)[0, 0], 0) a = tensor.ge(t, 3.45) self.assertEqual(tensor.to_numpy(a)[0, 0], 1)
def test_comparison_operators(self): t = self.t t += 3.45 a = t < 3.45 self.assertEqual(tensor.to_numpy(a)[0, 0], 0) a = t <= 3.45 self.assertEqual(tensor.to_numpy(a)[0, 0], 1) a = t > 3.45 self.assertEqual(tensor.to_numpy(a)[0, 0], 0) a = t >= 3.45 self.assertEqual(tensor.to_numpy(a)[0, 0], 1) a = tensor.lt(t, 3.45) self.assertEqual(tensor.to_numpy(a)[0, 0], 0) a = tensor.le(t, 3.45) self.assertEqual(tensor.to_numpy(a)[0, 0], 1) a = tensor.gt(t, 3.45) self.assertEqual(tensor.to_numpy(a)[0, 0], 0) a = tensor.ge(t, 3.45) self.assertEqual(tensor.to_numpy(a)[0, 0], 1)