class_docstr: Compressed Sparse Tensor 
class_docstr_tok: ["Compressed","Sparse","Tensor"]
code: def __init__(self, dense_tensor=None):
      self.orig_dense_tensor = dense_tensor
      self.dtype = self.orig_dense_tensor.dtype
      self.is_sparse = dense_tensor.is_sparse
      if dense_tensor is not None:
          if dense_tensor.is_sparse:
              dense_tensor = dense_tensor.coalesce()
              self.indices = dense_tensor.indices().flatten()
              self.values = dense_tensor.values()
          else:
              result = torch.sum(dense_tensor, dim=1)
              self.indices = result.nonzero().flatten()
              self.values = dense_tensor[self.indices]
          self.dense_size = list(dense_tensor.size())
      else:
          self.indices = None
          self.values = None
          self.dense_size = None
  
file_path: DeepSpeed/deepspeed/runtime/sparse_tensor.py
imports: import torch
label_desc: Use image node_id 1 to create a new SparseTensor object from inherited base classes: object with example: obj = SparseTensor(dense_tensor)