ae74b5ea18fac7e272c9f25b5d9f2775956aa943,distributed/protocol/tests/test_cupy.py,,test_serialize_cupy_sparse,#Any#Any#Any#,82
Before Change
a_host = numpy.array([[0, 1, 0], [2, 0, 3], [0, 4, 0]], dtype=dtype)
a = cupy.asarray(a_host)
anz = a.nonzero()
acoo = cupy_sparse.coo_matrix((a[anz], anz))
asp = sparse_type(acoo)
header, frames = serialize(asp, serializers=[serializer])
asp2 = deserialize(header, frames)
After Change
a_host = numpy.array([[0, 1, 0], [2, 0, 3], [0, 4, 0]], dtype=dtype)
asp_host = scipy_sparse_type(a_host)
if sparse_name == "dia_matrix":
// CuPy `dia_matrix` cannot be created from SciPy one
// xref: https://github.com/cupy/cupy/issues/3158
asp_dev = cupy_sparse_type(
(asp_host.data, asp_host.offsets),
shape=asp_host.shape,
dtype=asp_host.dtype,
)
else:
asp_dev = cupy_sparse_type(asp_host)
header, frames = serialize(asp_dev, serializers=[serializer])
a2sp_dev = deserialize(header, frames)
a2sp_host = a2sp_dev.get()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: dask/distributed
Commit Name: ae74b5ea18fac7e272c9f25b5d9f2775956aa943
Time: 2020-03-05
Author: jakirkham@gmail.com
File Name: distributed/protocol/tests/test_cupy.py
Class Name:
Method Name: test_serialize_cupy_sparse
Project Name: BindsNET/bindsnet
Commit Name: dcc5890dc2773090ab46a5e8bdd981a1104d9273
Time: 2018-06-29
Author: djsaunde@umass.edu
File Name: bindsnet/evaluation/__init__.py
Class Name:
Method Name: ngram
Project Name: sentinel-hub/eo-learn
Commit Name: d4be1706ea38f52a4291c01261be4875246a523c
Time: 2019-04-29
Author: matej.aleksandrov@sinergise.com
File Name: io/eolearn/io/local_io.py
Class Name: ExportToTiff
Method Name: _get_bands_subset