(self, dev)
| 642 | self._Mean_helper(gpu_dev) |
| 643 | |
| 644 | def _Exp_helper(self, dev): |
| 645 | X = np.array([0.8, -1.2, 3.3, -3.6, -0.5, |
| 646 | 0.5]).reshape(3, 2).astype(np.float32) |
| 647 | XT = np.exp(X) |
| 648 | x = tensor.from_numpy(X) |
| 649 | x.to_device(dev) |
| 650 | |
| 651 | result = autograd.exp(x) |
| 652 | dx = result.creator.backward(x.data) |
| 653 | |
| 654 | np.testing.assert_array_almost_equal(tensor.to_numpy(result), |
| 655 | XT, |
| 656 | decimal=5) |
| 657 | self.check_shape(dx.shape(), (3, 2)) |
| 658 | |
| 659 | def test_Exp_cpu(self): |
| 660 | self._Exp_helper(cpu_dev) |
no test coverage detected