code: def load_embs(standalone, emb_layer, g):
      nodes = dgl.distributed.node_split(
          np.arange(g.num_nodes()),
          g.get_partition_book(),
          force_even=True,
      )
      x = dgl.distributed.DistTensor(
          (
              g.num_nodes(),
              emb_layer.module.emb_size
              if isinstance(
                  emb_layer, th.nn.parallel.DistributedDataParallel
              )
              else emb_layer.emb_size,
          ),
          th.float32,
          "eval_embs",
          persistent=True,
      )
      num_nodes = nodes.shape[0]
      for i in range((num_nodes + 1023) // 1024):
          idx = nodes[
              i * 1024 : (i + 1) * 1024
              if (i + 1) * 1024 < num_nodes
              else num_nodes
          ]
          embeds = emb_layer(idx).cpu()
          x[idx] = embeds
  
      if not standalone:
          g.barrier()
  
      return x
  
file_path: dgl/examples/pytorch/graphsage/dist/train_dist_transductive.py
imports: import argparse
  import time
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  import dgl
  from dgl.distributed import DistEmbedding
  from train_dist import DistSAGE, compute_acc
label_desc: Use image node_id 2 for calling a global function with example usage: load_embs(standalone, emb_layer, g) and returns: x