(self, dev)
| 636 | self._Acos_helper(gpu_dev) |
| 637 | |
| 638 | def _Acosh_helper(self, dev): |
| 639 | x = np.array([0.1, -1.0, 0.4, 4.0, -0.9, |
| 640 | 9.0]).reshape(3, 2).astype(np.float32) |
| 641 | x = tensor.from_numpy(x) |
| 642 | y = autograd.Acosh()(x)[0] |
| 643 | |
| 644 | # frontend |
| 645 | model = sonnx.to_onnx([x], [y]) |
| 646 | # print('The model is:\n{}'.format(model)) |
| 647 | |
| 648 | # backend |
| 649 | sg_ir = sonnx.prepare(model, device=dev) |
| 650 | sg_ir.is_graph = True |
| 651 | y_t = sg_ir.run([x]) |
| 652 | |
| 653 | np.testing.assert_array_almost_equal(tensor.to_numpy(y), |
| 654 | tensor.to_numpy(y_t[0]), |
| 655 | decimal=5) |
| 656 | |
| 657 | def test_Acosh_cpu(self): |
| 658 | self._Acosh_helper(cpu_dev) |
no test coverage detected