code: def model_dgl2pgl(args):
      if args.model_name == "TransE":
          dgl_model_name = "TransE_l2"
      else:
          dgl_model_name = args.model_name
      embedding_file = os.path.join(
          args.init_from_ckpt,
          args.dataset + "_" + dgl_model_name + "_entity.npy",
      )
      relation_file = os.path.join(
          args.init_from_ckpt,
          args.dataset + "_" + dgl_model_name + "_relation.npy",
      )
      embedding_tensor = paddle.to_tensor(np.load(embedding_file))
      relation_tensor = paddle.to_tensor(np.load(relation_file))
      state_dict = {
          "ent_embedding.weight": embedding_tensor,
          "rel_embedding.weight": relation_tensor,
      }
      if not os.path.exists(args.save_path):
          os.makedirs(args.save_path)
      paddle.save(
          state_dict, os.path.join(args.save_path, "params.pdparams")
      )
      logger.info("The DGL parameter convert to PGL parameter success.")
  
file_path: PGL/examples/AITISA/kg/convert_tools.py
imports: import os
  import argparse
  import logging
  import numpy
  import paddle
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: model_dgl2pgl(args) without return types