(self, dev)
| 610 | self._Tanh_helper(gpu_dev) |
| 611 | |
| 612 | def _Acos_helper(self, dev): |
| 613 | x = np.array([0.1, -1.0, 0.4, 4.0, -0.9, |
| 614 | 9.0]).reshape(3, 2).astype(np.float32) |
| 615 | x = tensor.from_numpy(x) |
| 616 | y = autograd.Acos()(x)[0] |
| 617 | |
| 618 | # frontend |
| 619 | model = sonnx.to_onnx([x], [y]) |
| 620 | # print('The model is:\n{}'.format(model)) |
| 621 | |
| 622 | # backend |
| 623 | sg_ir = sonnx.prepare(model, device=dev) |
| 624 | sg_ir.is_graph = True |
| 625 | y_t = sg_ir.run([x]) |
| 626 | |
| 627 | np.testing.assert_array_almost_equal(tensor.to_numpy(y), |
| 628 | tensor.to_numpy(y_t[0]), |
| 629 | decimal=5) |
| 630 | |
| 631 | def test_Acos_cpu(self): |
| 632 | self._Acos_helper(cpu_dev) |
no test coverage detected