(self, dev)
| 693 | self._Identity_helper(gpu_dev) |
| 694 | |
| 695 | def _LeakyRelu_helper(self, dev): |
| 696 | X = np.array([0.8, -1.2, 3.3, -3.6, -0.5, |
| 697 | 0.5]).reshape(3, 2).astype(np.float32) |
| 698 | XT = np.array([0.8, -0.012, 3.3, -0.036, -0.005, |
| 699 | 0.5]).reshape(3, 2).astype(np.float32) |
| 700 | x = tensor.from_numpy(X) |
| 701 | x.to_device(dev) |
| 702 | |
| 703 | result = autograd.leakyrelu(x) |
| 704 | |
| 705 | dx = result.creator.backward(x.data) |
| 706 | |
| 707 | np.testing.assert_array_almost_equal(tensor.to_numpy(result), XT) |
| 708 | self.check_shape(dx.shape(), (3, 2)) |
| 709 | |
| 710 | def test_LeakyRelu_cpu(self): |
| 711 | self._LeakyRelu_helper(cpu_dev) |
no test coverage detected