(self, dev)
| 532 | self._Sin_helper(gpu_dev) |
| 533 | |
| 534 | def _Sinh_helper(self, dev): |
| 535 | x = np.array([0.1, -1.0, 0.4, 4.0, -0.9, |
| 536 | 9.0]).reshape(3, 2).astype(np.float32) |
| 537 | x = tensor.from_numpy(x) |
| 538 | y = autograd.Sinh()(x)[0] |
| 539 | |
| 540 | # frontend |
| 541 | model = sonnx.to_onnx([x], [y]) |
| 542 | # print('The model is:\n{}'.format(model)) |
| 543 | |
| 544 | # backend |
| 545 | sg_ir = sonnx.prepare(model, device=dev) |
| 546 | sg_ir.is_graph = True |
| 547 | y_t = sg_ir.run([x]) |
| 548 | |
| 549 | np.testing.assert_array_almost_equal(tensor.to_numpy(y), |
| 550 | tensor.to_numpy(y_t[0]), |
| 551 | decimal=5) |
| 552 | |
| 553 | def test_Sinh_cpu(self): |
| 554 | self._Sinh_helper(cpu_dev) |
no test coverage detected