(self, dev)
| 1975 | self._and_helper(gpu_dev) |
| 1976 | |
| 1977 | def _or_helper(self, dev): |
| 1978 | x0 = np.array([1.0, 1.0, 2.0, -3.0, 0, |
| 1979 | -7.0]).reshape(3, 2).astype(np.float32) |
| 1980 | x1 = np.array([-1.0, 0, 2.0, 4.0, 0, |
| 1981 | -7.0]).reshape(3, 2).astype(np.float32) |
| 1982 | |
| 1983 | y = np.logical_or(x0, x1) |
| 1984 | x0 = tensor.from_numpy(x0) |
| 1985 | x1 = tensor.from_numpy(x1) |
| 1986 | x0.to_device(dev) |
| 1987 | x1.to_device(dev) |
| 1988 | |
| 1989 | result = autograd._or(x0, x1) |
| 1990 | |
| 1991 | np.testing.assert_array_almost_equal(tensor.to_numpy(result), |
| 1992 | y, |
| 1993 | decimal=5) |
| 1994 | |
| 1995 | def test_or_cpu(self): |
| 1996 | self._or_helper(cpu_dev) |
no test coverage detected