diff options
Diffstat (limited to 'test/test_backend.py')
-rw-r--r-- | test/test_backend.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_backend.py b/test/test_backend.py index fd9a761..5351e52 100644 --- a/test/test_backend.py +++ b/test/test_backend.py @@ -296,6 +296,8 @@ def test_empty_backend(): nx.atan2(v, v) with pytest.raises(NotImplementedError): nx.transpose(M) + with pytest.raises(NotImplementedError): + nx.detach(M) def test_func_backends(nx): @@ -649,6 +651,16 @@ def test_func_backends(nx): lst_b.append(nx.to_numpy(A)) lst_name.append("transpose") + A = nx.detach(Mb) + lst_b.append(nx.to_numpy(A)) + lst_name.append("detach") + + A, B = nx.detach(Mb, Mb) + lst_b.append(nx.to_numpy(A)) + lst_name.append("detach A") + lst_b.append(nx.to_numpy(B)) + lst_name.append("detach B") + assert not nx.array_equal(Mb, vb), "array_equal (shape)" assert nx.array_equal(Mb, Mb), "array_equal (elements) - expected true" assert not nx.array_equal( |