code: def add_(src: SparseTensor, other: torch.Tensor) -> SparseTensor:
      rowptr, col, value = src.csr()
      if (
          other.size(0) == src.size(0) and other.size(1) == 1
      ):  # Row-wise.
          other = gather_csr(other.squeeze(1), rowptr)
      elif other.size(0) == 1 and other.size(1) == src.size(
          1
      ):  # Col-wise.
          other = other.squeeze(0)[col]
      else:
          raise ValueError(
              f"Size mismatch: Expected size ({src.size(0)}, 1, ...) or "
              f"(1, {src.size(1)}, ...), but got size {other.size()}."
          )
  
      if value is not None:
          value = value.add_(other.to(value.dtype))
      else:
          value = other.add_(1)
      return src.set_value_(value, layout="coo")
  
file_path: pytorch_sparse/torch_sparse/add.py
imports: from typing import Optional
  import torch
  from torch import Tensor
  from torch_scatter import gather_csr
  from torch_sparse.tensor import SparseTensor
label_desc: Use image node_id 4 for calling a global function with example usage: add_(src, other) and returns: src