(self, dev)
| 662 | self._Acosh_helper(gpu_dev) |
| 663 | |
| 664 | def _Asin_helper(self, dev): |
| 665 | x = np.array([0.1, -1.0, 0.4, 4.0, -0.9, |
| 666 | 9.0]).reshape(3, 2).astype(np.float32) |
| 667 | x = tensor.from_numpy(x) |
| 668 | y = autograd.Asin()(x)[0] |
| 669 | |
| 670 | # frontend |
| 671 | model = sonnx.to_onnx([x], [y]) |
| 672 | # print('The model is:\n{}'.format(model)) |
| 673 | |
| 674 | # backend |
| 675 | sg_ir = sonnx.prepare(model, device=dev) |
| 676 | sg_ir.is_graph = True |
| 677 | y_t = sg_ir.run([x]) |
| 678 | |
| 679 | np.testing.assert_array_almost_equal(tensor.to_numpy(y), |
| 680 | tensor.to_numpy(y_t[0]), |
| 681 | decimal=5) |
| 682 | |
| 683 | def test_Asin_cpu(self): |
| 684 | self._Asin_helper(cpu_dev) |
no test coverage detected