(self)
| 637 | orig.values = new_data |
| 638 | |
| 639 | def test_replace(self): |
| 640 | var = Variable(("x", "y"), [[1.5, 2.0], [3.1, 4.3]], {"foo": "bar"}) |
| 641 | result = var._replace() |
| 642 | assert_identical(result, var) |
| 643 | |
| 644 | new_data = np.arange(4).reshape(2, 2) |
| 645 | result = var._replace(data=new_data) |
| 646 | assert_array_equal(result.data, new_data) |
| 647 | |
| 648 | def test_real_and_imag(self): |
| 649 | v = self.cls("x", np.arange(3) - 1j * np.arange(3), {"foo": "bar"}) |
nothing calls this directly
no test coverage detected