code: def cat_first(tensors: List[SparseTensor]) -> SparseTensor:
      rows: List[torch.Tensor] = []
      rowptrs: List[torch.Tensor] = []
      cols: List[torch.Tensor] = []
      values: List[torch.Tensor] = []
      sparse_sizes: List[int] = [0, 0]
      rowcounts: List[torch.Tensor] = []
  
      nnz: int = 0
      for tensor in tensors:
          row = tensor.storage._row
          if row is not None:
              rows.append(row + sparse_sizes[0])
  
          rowptr = tensor.storage._rowptr
          if rowptr is not None:
              rowptrs.append(
                  rowptr[1:] + nnz if len(rowptrs) > 0 else rowptr
              )
  
          cols.append(tensor.storage._col)
  
          value = tensor.storage._value
          if value is not None:
              values.append(value)
  
          rowcount = tensor.storage._rowcount
          if rowcount is not None:
              rowcounts.append(rowcount)
  
          sparse_sizes[0] += tensor.sparse_size(0)
          sparse_sizes[1] = max(sparse_sizes[1], tensor.sparse_size(1))
          nnz += tensor.nnz()
  
      row: Optional[torch.Tensor] = None
      if len(rows) == len(tensors):
          row = torch.cat(rows, dim=0)
  
      rowptr: Optional[torch.Tensor] = None
      if len(rowptrs) == len(tensors):
          rowptr = torch.cat(rowptrs, dim=0)
  
      col = torch.cat(cols, dim=0)
  
      value: Optional[torch.Tensor] = None
      if len(values) == len(tensors):
          value = torch.cat(values, dim=0)
  
      rowcount: Optional[torch.Tensor] = None
      if len(rowcounts) == len(tensors):
          rowcount = torch.cat(rowcounts, dim=0)
  
      storage = SparseStorage(
          row=row,
          rowptr=rowptr,
          col=col,
          value=value,
          sparse_sizes=(sparse_sizes[0], sparse_sizes[1]),
          rowcount=rowcount,
          colptr=None,
          colcount=None,
          csr2csc=None,
          csc2csr=None,
          is_sorted=True,
      )
      return tensors[0].from_storage(storage)
  
file_path: pytorch_sparse/torch_sparse/cat.py
imports: from typing import Optional, List, Tuple
  import torch
  from torch_sparse.storage import SparseStorage
  from torch_sparse.tensor import SparseTensor
label_desc: Use image node_id 5 for calling a global function with example usage: cat_first(tensors) and returns: tensors