()
| 206 | |
| 207 | |
| 208 | def test_format(): |
| 209 | x_np = np.random.rand(2, 4, 6, 8).astype("float32") |
| 210 | x = Tensor(x_np) |
| 211 | assert x.format == "default" |
| 212 | x.format = "nhwc" |
| 213 | assert x.format == "nhwc" |
| 214 | x2 = copy.copy(x) |
| 215 | assert x2.format == "nhwc" |
| 216 | np.testing.assert_allclose(x.numpy(), x2.numpy()) |
| 217 | x3 = copy.deepcopy(x) |
| 218 | assert x3.format == "nhwc" |
| 219 | np.testing.assert_allclose(x.numpy(), x3.numpy()) |
| 220 | |
| 221 | |
| 222 | def test_name(): |