docstr: g : the whole graph
  seed_nodes : the output nodes for the current layer
  weight : the weight of the edges
  return : the unnormalized probability of the candidate nodes, as well as the subgraph
           containing all the edges from the candidate nodes to the output nodes.
docstr_tok: ["g",":","the","whole","graph","seed_nodes",":","the","output","nodes","for","the","current","layer","weight",":","the","weight","of","the","edges","return",":","the","unnormalized","probability","of","the","candidate","nodes",",","as","well","as","the","subgraph","containing","all","the","edges","from","the","candidate","nodes","to","the","output","nodes","."]
code: def compute_prob(self, g, seed_nodes, weight, num):
      """
      g : the whole graph
      seed_nodes : the output nodes for the current layer
      weight : the weight of the edges
      return : the unnormalized probability of the candidate nodes, as well as the subgraph
               containing all the edges from the candidate nodes to the output nodes.
      """
      prob, insg = super().compute_prob(g, seed_nodes, weight, num)
  
      one = torch.ones_like(prob)
      if prob.shape[0] <= num:
          return one, insg
  
      c = 1.0
      for i in range(50):
          S = torch.sum(
              torch.minimum(prob * c, one).to(torch.float64)
          ).item()
          if min(S, num) / max(S, num) >= self.eps:
              break
          else:
              c *= num / S
  
      if self.skip:
          skip_nodes = find_indices_in(seed_nodes, insg.ndata[dgl.NID])
          prob[skip_nodes] = float("inf")
  
      return torch.minimum(prob * c, one), insg
  
file_path: dgl/examples/pytorch/labor/ladies_sampler.py
imports: import dgl
  import dgl.function
  import torch
label_desc: Use image node_id 2 for calling the PoissonLadiesSampler obj's underlying member method code with example usage: obj.compute_prob(g, seed_nodes, weight, num) and returns: torch,  insg, one,  insg