zeros#

iskra.sparse.zeros(size: Size | list[int] | tuple[int, ...], dtype: dtype = torch.float32, device: str | device = 'cpu') → SparseTensor[SOURCE]#

Constructs a sparse COO zero matrix.

Parameters:
  • size (list[int] | tuple[int, ...] | None) – Size of the sparse tensor.

  • dtype (torch.dtype) – Matrix data type. Defaults to torch.float32.

  • device (str | torch.device, optional) – Device for the matrix. Defaults to “cpu”.

Returns:

​ (SparseTensor[DType, size]) – Sparse n-by-n identity matrix in COO format.