MCPcopy Create free account
hub / github.com/dask/dask / test_array_function_sparse_tensordot

Function test_array_function_sparse_tensordot

dask/array/tests/test_array_function.py:113–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111
112
113def test_array_function_sparse_tensordot():
114 sparse = pytest.importorskip("sparse")
115 rng = np.random.default_rng()
116 x = rng.random((2, 3, 4))
117 x[x < 0.9] = 0
118 y = rng.random((4, 3, 2))
119 y[y < 0.9] = 0
120
121 xx = sparse.COO(x)
122 yy = sparse.COO(y)
123
124 assert_eq(
125 np.tensordot(x, y, axes=(2, 0)), np.tensordot(xx, yy, axes=(2, 0)).todense()
126 )
127
128
129@pytest.mark.parametrize("chunks", [(100, 100), (500, 100)])

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
randomMethod · 0.45

Tested by

no test coverage detected