(self, dev)
| 93 | (_tuple_to_string(actual), _tuple_to_string(expect))) |
| 94 | |
| 95 | def _greater_helper(self, dev): |
| 96 | x0 = np.array([-0.9, -0.3, -0.1, 0.1, 0.5, |
| 97 | 0.9]).reshape(3, 2).astype(np.float32) |
| 98 | x1 = np.array([0, -0.3, 0, 0.1, 0, 0.9]).reshape(3, |
| 99 | 2).astype(np.float32) |
| 100 | y = np.greater(x0, x1) |
| 101 | x0 = tensor.from_numpy(x0) |
| 102 | x1 = tensor.from_numpy(x1) |
| 103 | x0.to_device(dev) |
| 104 | x1.to_device(dev) |
| 105 | |
| 106 | result = autograd.greater(x0, x1) |
| 107 | |
| 108 | np.testing.assert_array_almost_equal(tensor.to_numpy(result), |
| 109 | y, |
| 110 | decimal=5) |
| 111 | |
| 112 | def test_Greater_cpu(self): |
| 113 | self._greater_helper(cpu_dev) |
no test coverage detected