code: def model_pgl2dgl(args):
      state_dict = paddle.load(
          os.path.join(args.init_from_ckpt, "params.pdparams")
      )
      if args.model_name == "TransE":
          dgl_model_name = "TransE_l2"
      else:
          dgl_model_name = args.model_name
      mapped_dict = {
          "ent_embedding.weight": args.dataset
          + "_"
          + dgl_model_name
          + "_entity.npy",
          "rel_embedding.weight": args.dataset
          + "_"
          + dgl_model_name
          + "_relation.npy",
      }
      if not os.path.exists(args.save_path):
          os.makedirs(args.save_path)
  
      for key in mapped_dict.keys():
          parameter = state_dict[key].numpy()
          parameter_file_name = mapped_dict[key]
          with open(
              os.path.join(args.save_path, parameter_file_name), "wb"
          ) as f:
              np.save(f, parameter)
  
      logger.info("The PGL parameter convert to DGL 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 1 for calling a global function with example usage: model_pgl2dgl(args) without return types