(self, scipy_backend)
| 2857 | return backend |
| 2858 | |
| 2859 | def test_get_variable_tensor(self, scipy_backend): |
| 2860 | outer = scipy_backend.get_variable_tensor((2,), 1) |
| 2861 | assert outer.keys() == {1}, "Should only be in variable with ID 1" |
| 2862 | inner = outer[1] |
| 2863 | assert inner.keys() == {-1}, "Should only be in parameter slice -1, i.e. non parametrized." |
| 2864 | tensor = inner[-1] |
| 2865 | assert sp.issparse(tensor), "Should be a scipy sparse matrix or array" |
| 2866 | assert tensor.shape == (2, 2), "Should be a 1*2x2 tensor" |
| 2867 | assert np.all(tensor == np.eye(2)), "Should be eye(2)" |
| 2868 | |
| 2869 | @pytest.mark.parametrize("data", [np.array([[1, 2], [3, 4]]), sp.eye_array(2) * 4]) |
| 2870 | def test_get_data_tensor(self, scipy_backend, data): |
nothing calls this directly
no test coverage detected