MCPcopy Create free account
hub / github.com/PythonOT/POT / coo_matrix

Method coo_matrix

ot/backend.py:1743–1751  ·  view source on GitHub ↗
(self, data, rows, cols, shape=None, type_as=None)

Source from the content-addressed store, hash-verified

1741 return jax.random.permutation(subkey, size)
1742
1743 def coo_matrix(self, data, rows, cols, shape=None, type_as=None):
1744 # Currently, JAX does not support sparse matrices
1745 data = self.to_numpy(data)
1746 rows = self.to_numpy(rows)
1747 cols = self.to_numpy(cols)
1748 nx = NumpyBackend()
1749 coo_matrix = nx.coo_matrix(data, rows, cols, shape=shape, type_as=type_as)
1750 matrix = nx.todense(coo_matrix)
1751 return self.from_numpy(matrix)
1752
1753 def issparse(self, a):
1754 # Currently, JAX does not support sparse matrices

Callers

nothing calls this directly

Calls 5

coo_matrixMethod · 0.95
todenseMethod · 0.95
NumpyBackendClass · 0.85
to_numpyMethod · 0.80
from_numpyMethod · 0.80

Tested by

no test coverage detected