class_docstr: The layer-dependent importance sampler from the
  `"Layer-Dependent Importance Sampling for Training Deep and Large Graph Convolutional Networks"
  <https://arxiv.org/abs/1911.07323>`_ literature,  which allows
  for mini-batch training of GNNs on large-scale graphs where full-batch training is not feasible.
  
  Arguments
  ------------
  edge_index:
      A :obj:`torch.LongTensor` that defines the underlying graph
      connectivity/message passing flow.
      :obj:`edge_index` holds the indices of a (sparse) adjacency matrix.
      If :obj:`edge_index` is of type :obj:`torch.LongTensor`, its shape
      must be defined as :obj:`[2, num_edges]`, where messages from nodes
      :obj:`edge_index[0]` are sent to nodes in :obj:`edge_index[1]`
      (in case :obj:`flow="source_to_target"`).
  target_nodes_indexes:
      indexes of target nodes to learn representation.
  layer_wise_arguments:
      The number of nodes to sample for each layer.
      It's noteworthy that the target nodes for a specific layer
      always be preserved as source nodes for that layer,
      such that the self loops for those target nodes
      are generally preserved for representation learning.
  batch_size:
      number of target nodes for each mini-batch.
  num_workers:
      num_workers argument for inner :class:`torch.utils.data.DataLoader`
  shuffle:
      whether to shuffle target nodes for mini-batches.
class_docstr_tok: ["The","layer-dependent","importance","sampler","from","the","`","``","Layer-Dependent","Importance","Sampling","for","Training","Deep","and","Large","Graph","Convolutional","Networks","''","<","https",":","\/\/arxiv.org\/abs\/1911.07323",">","`","_","literature",",","which","allows","for","mini-batch","training","of","GNNs","on","large-scale","graphs","where","full-batch","training","is","not","feasible",".","Arguments","--","--","--","--","--","--","edge_index",":","A",":","obj",":","`","torch.LongTensor","`","that","defines","the","underlying","graph","connectivity\/message","passing","flow",".",":","obj",":","`","edge_index","`","holds","the","indices","of","a","(","sparse",")","adjacency","matrix",".","If",":","obj",":","`","edge_index","`","is","of","type",":","obj",":","`","torch.LongTensor","`",",","its","shape","must","be","defined","as",":","obj",":","`","[","2",",","num_edges","]","`",",","where","messages","from","nodes",":","obj",":","`","edge_index","[","0","]","`","are","sent","to","nodes","in",":","obj",":","`","edge_index","[","1","]","`","(","in","case",":","obj",":","`","flow=","''","source_to_target","''","`",")",".","target_nodes_indexes",":","indexes","of","target","nodes","to","learn","representation",".","layer_wise_arguments",":","The","number","of","nodes","to","sample","for","each","layer",".","It","'s","noteworthy","that","the","target","nodes","for","a","specific","layer","always","be","preserved","as","source","nodes","for","that","layer",",","such","that","the","self","loops","for","those","target","nodes","are","generally","preserved","for","representation","learning",".","batch_size",":","number","of","target","nodes","for","each","mini-batch",".","num_workers",":","num_workers","argument","for","inner",":","class",":","`","torch.utils.data.DataLoader","`","shuffle",":","whether","to","shuffle","target","nodes","for","mini-batches","."]
code: def __compute_edge_weight(
      cls, edge_index: torch.Tensor
  ) -> torch.Tensor:
      __num_nodes: int = (
          max(int(edge_index[0].max()), int(edge_index[1].max())) + 1
      )
      _temp_tensor: torch.Tensor = torch.stack(
          [
              torch_geometric.utils.degree(edge_index[0], __num_nodes)[
                  edge_index[0]
              ],
              torch_geometric.utils.degree(edge_index[1], __num_nodes)[
                  edge_index[1]
              ],
          ]
      )
      _temp_tensor: torch.Tensor = torch.pow(_temp_tensor, -0.5)
      _temp_tensor[torch.isinf(_temp_tensor)] = 0
      return _temp_tensor[0] * _temp_tensor[1]
  
file_path: AutoGL/autogl/module/train/sampling/sampler/layer_dependent_importance_sampler.py
imports: import numpy
  import scipy.sparse
  import torch
  import torch.utils.data
  import typing
  import torch_geometric
  from .None import target_dependant_sampler
label_desc: Use image node_id 1 for calling the LayerDependentImportanceSampler obj's underlying member method code with example usage: obj.__compute_edge_weight(cls, edge_index) and returns: unknown