(self)
| 1840 | a + c |
| 1841 | |
| 1842 | def test_inplace_math(self): |
| 1843 | x = np.arange(5) |
| 1844 | v = Variable(["x"], x) |
| 1845 | v2 = v |
| 1846 | v2 += 1 |
| 1847 | assert v is v2 |
| 1848 | # since we provided an ndarray for data, it is also modified in-place |
| 1849 | assert source_ndarray(v.values) is x |
| 1850 | assert_array_equal(v.values, np.arange(5) + 1) |
| 1851 | |
| 1852 | with pytest.raises(ValueError, match=r"dimensions cannot change"): |
| 1853 | v += Variable("y", np.arange(5)) |
| 1854 | |
| 1855 | def test_inplace_math_error(self): |
| 1856 | x = np.arange(5) |
nothing calls this directly
no test coverage detected