(self)
| 1550 | v.roll(z=0) |
| 1551 | |
| 1552 | def test_roll_consistency(self): |
| 1553 | v = Variable(("x", "y"), np.random.randn(5, 6)) |
| 1554 | |
| 1555 | for axis, dim in [(0, "x"), (1, "y")]: |
| 1556 | for shift in [-3, 0, 1, 7, 11]: |
| 1557 | expected = np.roll(v.values, shift, axis=axis) |
| 1558 | actual = v.roll(**{dim: shift}).values |
| 1559 | assert_array_equal(expected, actual) |
| 1560 | |
| 1561 | def test_transpose(self): |
| 1562 | v = Variable(["time", "x"], self.d) |