(dev)
| 59 | |
| 60 | |
| 61 | def prepare_inputs_targets_for_rnn_test(dev): |
| 62 | x_0 = np.random.random((2, 3)).astype(np.float32) |
| 63 | x_1 = np.random.random((2, 3)).astype(np.float32) |
| 64 | x_2 = np.random.random((2, 3)).astype(np.float32) |
| 65 | |
| 66 | h_0 = np.zeros((2, 2)).astype(np.float32) |
| 67 | |
| 68 | t_0 = np.random.random((2, 2)).astype(np.float32) |
| 69 | t_1 = np.random.random((2, 2)).astype(np.float32) |
| 70 | t_2 = np.random.random((2, 2)).astype(np.float32) |
| 71 | |
| 72 | x0 = tensor.Tensor(device=dev, data=x_0) |
| 73 | x1 = tensor.Tensor(device=dev, data=x_1) |
| 74 | x2 = tensor.Tensor(device=dev, data=x_2) |
| 75 | |
| 76 | h0 = tensor.Tensor(device=dev, data=h_0) |
| 77 | |
| 78 | t0 = tensor.Tensor(device=dev, data=t_0) |
| 79 | t1 = tensor.Tensor(device=dev, data=t_1) |
| 80 | t2 = tensor.Tensor(device=dev, data=t_2) |
| 81 | |
| 82 | inputs = [x0, x1, x2] |
| 83 | targets = [t0, t1, t2] |
| 84 | return inputs, targets, h0 |
| 85 | |
| 86 | |
| 87 | class TestPythonOperation(unittest.TestCase): |
no test coverage detected