(self, dev)
| 1855 | self._gather_helper(gpu_dev) |
| 1856 | |
| 1857 | def _tile_helper(self, dev): |
| 1858 | X = np.array([0, 1, 2]).astype(np.float32) |
| 1859 | x = tensor.from_numpy(X) |
| 1860 | x.to_device(dev) |
| 1861 | y = autograd.tile(x, [2, 2]) |
| 1862 | |
| 1863 | # frontend |
| 1864 | model = sonnx.to_onnx([x], [y]) |
| 1865 | # print('The model is:\n{}'.format(model)) |
| 1866 | |
| 1867 | # backend |
| 1868 | sg_ir = sonnx.prepare(model, device=dev) |
| 1869 | sg_ir.is_graph = True |
| 1870 | y_t = sg_ir.run([x]) |
| 1871 | |
| 1872 | np.testing.assert_array_almost_equal( |
| 1873 | tensor.to_numpy(y).shape, |
| 1874 | tensor.to_numpy(y_t[0]).shape) |
| 1875 | |
| 1876 | def test_tile_cpu(self): |
| 1877 | self._tile_helper(cpu_dev) |
no test coverage detected