(self, dev)
| 740 | self._Atan_helper(gpu_dev) |
| 741 | |
| 742 | def _Atanh_helper(self, dev): |
| 743 | x = np.array([0.1, -1.0, 0.4, 4.0, -0.9, |
| 744 | 9.0]).reshape(3, 2).astype(np.float32) |
| 745 | x = tensor.from_numpy(x) |
| 746 | y = autograd.Atanh()(x)[0] |
| 747 | |
| 748 | # frontend |
| 749 | model = sonnx.to_onnx([x], [y]) |
| 750 | # print('The model is:\n{}'.format(model)) |
| 751 | |
| 752 | # backend |
| 753 | sg_ir = sonnx.prepare(model, device=dev) |
| 754 | sg_ir.is_graph = True |
| 755 | y_t = sg_ir.run([x]) |
| 756 | |
| 757 | np.testing.assert_array_almost_equal(tensor.to_numpy(y), |
| 758 | tensor.to_numpy(y_t[0]), |
| 759 | decimal=5) |
| 760 | |
| 761 | def test_Atanh_cpu(self): |
| 762 | self._Atanh_helper(cpu_dev) |
no test coverage detected