(self, dev)
| 1950 | self._SeLU_helper(gpu_dev) |
| 1951 | |
| 1952 | def _and_helper(self, dev): |
| 1953 | x0 = np.array([0, -0.3, -0.1, 0.1, 0.5, |
| 1954 | 0.9]).reshape(3, 2).astype(np.float32) |
| 1955 | x1 = np.array([0, -0.3, 0, 0.1, 0.5, 0.9]).reshape(3, |
| 1956 | 2).astype(np.float32) |
| 1957 | |
| 1958 | y = np.logical_and(x0, x1) |
| 1959 | x0 = tensor.from_numpy(x0) |
| 1960 | x1 = tensor.from_numpy(x1) |
| 1961 | x0.to_device(dev) |
| 1962 | x1.to_device(dev) |
| 1963 | |
| 1964 | result = autograd._and(x0, x1) |
| 1965 | |
| 1966 | np.testing.assert_array_almost_equal(tensor.to_numpy(result), |
| 1967 | y, |
| 1968 | decimal=5) |
| 1969 | |
| 1970 | def test_and_cpu(self): |
| 1971 | self._and_helper(cpu_dev) |
no test coverage detected