code: def compute_loss_para(adj):
      pos_weight = (adj.shape[0] * adj.shape[0] - adj.sum()) / adj.sum()
      norm = (
          adj.shape[0]
          * adj.shape[0]
          / float((adj.shape[0] * adj.shape[0] - adj.sum()) * 2)
      )
      weight_mask = adj.view(-1) == 1
      weight_tensor = torch.ones(weight_mask.size(0)).to(device)
      weight_tensor[weight_mask] = pos_weight
      return weight_tensor, norm
  
file_path: dgl/examples/pytorch/vgae/train.py
imports: import argparse
  import os
  import time
  import dgl
  import model
  import numpy
  import scipy.sparse
  import torch
  import torch.nn.functional
  from dgl.data import CiteseerGraphDataset, CoraGraphDataset, PubmedGraphDataset
  from input_data import load_data
  from preprocess import mask_test_edges, mask_test_edges_dgl, preprocess_graph, sparse_to_tuple
  from sklearn.metrics import average_precision_score, roc_auc_score
label_desc: Use image node_id 1 for calling a global function with example usage: compute_loss_para(adj) and returns: weight_tensor,  norm