cupy.sparse.spmatrix¶
-
class
cupy.sparse.
spmatrix
(maxprint=50)[source]¶ Base class of all sparse matrixes.
Methods
-
asformat
(format)[source]¶ Return this matrix in a given sparse format.
Parameters: format (str or None) – Format you need.
-
asfptype
()[source]¶ Upcasts matrix to a floating point format.
When the matrix has floating point type, the method returns itself. Otherwise it makes a copy with floating point type and the same format.
Returns: A matrix with float type. Return type: cupy.sparse.spmatrix
-
astype
(t)[source]¶ Casts the array to given data type.
Parameters: t – Type specifier. Returns: A copy of the array with the given type and the same format. Return type: cupy.sparse.spmatrix
-
get
(stream=None)[source]¶ Return a copy of the array on host memory.
Parameters: stream (cupy.cuda.Stream) – CUDA stream object. If it is given, the copy runs asynchronously. Otherwise, the copy is synchronous. Returns: An array on host memory. Return type: scipy.sparse.spmatrix
-
sum
(axis=None, dtype=None, out=None)[source]¶ Sums the matrix elements over a given axis.
Parameters: - axis (int or
None
) – Axis along which the sum is comuted. If it isNone
, it computes the sum of all the elements. Select from{None, 0, 1, -2, -1}
. - dtype – The type of returned matrix. If it is not specified, type of the array is used.
- out (cupy.ndarray) – Output matrix.
Returns: Summed array.
Return type: See also
- axis (int or
Attributes
-
H
¶
-
T
¶
-
device
¶ CUDA device on which this array resides.
-
ndim
¶
-
nnz
¶
-
shape
¶
-
size
¶
-