(self, dev)
| 688 | self._Asin_helper(gpu_dev) |
| 689 | |
| 690 | def _Asinh_helper(self, dev): |
| 691 | x = np.array([0.1, -1.0, 0.4, 4.0, -0.9, |
| 692 | 9.0]).reshape(3, 2).astype(np.float32) |
| 693 | x = tensor.from_numpy(x) |
| 694 | y = autograd.Asinh()(x)[0] |
| 695 | |
| 696 | # frontend |
| 697 | model = sonnx.to_onnx([x], [y]) |
| 698 | # print('The model is:\n{}'.format(model)) |
| 699 | |
| 700 | # backend |
| 701 | sg_ir = sonnx.prepare(model, device=dev) |
| 702 | sg_ir.is_graph = True |
| 703 | y_t = sg_ir.run([x]) |
| 704 | |
| 705 | np.testing.assert_array_almost_equal(tensor.to_numpy(y), |
| 706 | tensor.to_numpy(y_t[0]), |
| 707 | decimal=5) |
| 708 | |
| 709 | def test_Asinh_cpu(self): |
| 710 | self._Asinh_helper(cpu_dev) |
no test coverage detected