class_docstr: Converts the :obj:`edge_index` attributes of a homogeneous or
  heterogeneous data object into a **transposed**
  :class:`torch_sparse.SparseTensor` or :pytorch:`PyTorch`
  :class:`torch.sparse.Tensor` object with key :obj:`adj_t`
  (functional name: :obj:`to_sparse_tensor`).
  
  .. note::
  
      In case of composing multiple transforms, it is best to convert the
      :obj:`data` object via :class:`ToSparseTensor` as late as possible,
      since there exist some transforms that are only able to operate on
      :obj:`data.edge_index` for now.
  
  Args:
      attr (str, optional): The name of the attribute to add as a value to
          the :class:`~torch_sparse.SparseTensor` or
          :class:`torch.sparse.Tensor` object (if present).
          (default: :obj:`edge_weight`)
      remove_edge_index (bool, optional): If set to :obj:`False`, the
          :obj:`edge_index` tensor will not be removed.
          (default: :obj:`True`)
      fill_cache (bool, optional): If set to :obj:`True`, will fill the
          underlying :class:`torch_sparse.SparseTensor` cache (if used).
          (default: :obj:`True`)
      layout (torch.layout, optional): Specifies the layout of the returned
          sparse tensor (:obj:`None`, :obj:`torch.sparse_coo` or
          :obj:`torch.sparse_csr`).
          If set to :obj:`None` and the :obj:`torch_sparse` dependency is
          installed, will convert :obj:`edge_index` into a
          :class:`torch_sparse.SparseTensor` object.
          If set to :obj:`None` and the :obj:`torch_sparse` dependency is
          not installed, will convert :obj:`edge_index` into a
          :class:`torch.sparse.Tensor` object with layout
          :obj:`torch.sparse_csr`. (default: :obj:`None`)
class_docstr_tok: ["Converts","the",":","obj",":","`","edge_index","`","attributes","of","a","homogeneous","or","heterogeneous","data","object","into","a","*","*","transposed","*","*",":","class",":","`","torch_sparse.SparseTensor","`","or",":","pytorch",":","`","PyTorch","`",":","class",":","`","torch.sparse.Tensor","`","object","with","key",":","obj",":","`","adj_t","`","(","functional","name",":",":","obj",":","`","to_sparse_tensor","`",")",".","..","note",":",":","In","case","of","composing","multiple","transforms",",","it","is","best","to","convert","the",":","obj",":","`","data","`","object","via",":","class",":","`","ToSparseTensor","`","as","late","as","possible",",","since","there","exist","some","transforms","that","are","only","able","to","operate","on",":","obj",":","`","data.edge_index","`","for","now",".","Args",":","attr","(","str",",","optional",")",":","The","name","of","the","attribute","to","add","as","a","value","to","the",":","class",":","`","~torch_sparse.SparseTensor","`","or",":","class",":","`","torch.sparse.Tensor","`","object","(","if","present",")",".","(","default",":",":","obj",":","`","edge_weight","`",")","remove_edge_index","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","False","`",",","the",":","obj",":","`","edge_index","`","tensor","will","not","be","removed",".","(","default",":",":","obj",":","`","True","`",")","fill_cache","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","True","`",",","will","fill","the","underlying",":","class",":","`","torch_sparse.SparseTensor","`","cache","(","if","used",")",".","(","default",":",":","obj",":","`","True","`",")","layout","(","torch.layout",",","optional",")",":","Specifies","the","layout","of","the","returned","sparse","tensor","(",":","obj",":","`","None","`",",",":","obj",":","`","torch.sparse_coo","`","or",":","obj",":","`","torch.sparse_csr","`",")",".","If","set","to",":","obj",":","`","None","`","and","the",":","obj",":","`","torch_sparse","`","dependency","is","installed",",","will","convert",":","obj",":","`","edge_index","`","into","a",":","class",":","`","torch_sparse.SparseTensor","`","object",".","If","set","to",":","obj",":","`","None","`","and","the",":","obj",":","`","torch_sparse","`","dependency","is","not","installed",",","will","convert",":","obj",":","`","edge_index","`","into","a",":","class",":","`","torch.sparse.Tensor","`","object","with","layout",":","obj",":","`","torch.sparse_csr","`",".","(","default",":",":","obj",":","`","None","`",")"]
code: def __repr__(self) -> str:
      return (
          f"{self.__class__.__name__}(attr={self.attr}, "
          f"layout={self.layout})"
      )
  
file_path: pytorch_geometric/torch_geometric/transforms/to_sparse_tensor.py
imports: from typing import Optional, Union
  import torch
  from torch import Tensor
  import torch_geometric.typing
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.data.datapipes import functional_transform
  from torch_geometric.transforms import BaseTransform
  from torch_geometric.typing import SparseTensor
  from torch_geometric.utils import sort_edge_index, to_torch_coo_tensor, to_torch_csr_tensor
label_desc: Use image node_id 3 for calling the ToSparseTensor obj's underlying member method code with example usage: obj.__repr__() and returns: self, str, self, str, self, str