CSXMatrix3d

class src.sparse_torch.csx_matrix.CSXMatrix3d(inp, shape, device=None)[source]
as_list(mask=None)[source]

Return [indices, indptr, data] in a list. :param mask: Optional. It should be an iterable containing 3 items, each indicating its corresponding attribute

shall be masked out or not.

Returns

[indices, indptr, data] * mask

as_sparse_torch()[source]
as_ssp()[source]

Return scipy.sparse matrix. :return: list of scipy.sparse matrix

cpu()[source]

Compatible to torch.Tensor.cpu() :return: a new instance on CPU

cuda()[source]

Compatible to torch.Tensor.cuda() :return: a new instance on CUDA

property device
get_batch(item)[source]

Get a certain batch in tuple (indices, indptr, data) :param item: batch index :return: (indices, indptr, data)

numpy()[source]

Return dense numpy array. :return: dense numpy array.

shape_eq(other)[source]
property sptype
to(tgt)[source]

Compatible to torch.Tensor.to() :param tgt: target, can be torch.device or torch.dtype :return: a new instance

transpose(keep_type=False)[source]