code: def data2tensor(batch_dict):
      feed_dict = {}
      for key, value in batch_dict.items():
          if isinstance(value, pgl.Graph):
              feed_dict[key] = value.tensor()
          elif isinstance(value, np.ndarray):
              feed_dict[key] = paddle.to_tensor(value)
          else:
              raise TypeError(
                  "can not convert a type of [%s] to paddle Tensor"
                  % type(value)
              )
      return feed_dict
  
imports: import os
  import sys
  import time
  import tqdm
  import yaml
  import argparse
  import numpy
  import pgl
  from pgl.utils.logger import log
  from pgl.utils.data import Dataloader, StreamDataset
  import paddle
  import paddle.nn
  from paddle.optimizer import Adam
  from utils.config import prepare_config
  from utils.logger import log_to_file
  import models
  import datasets.dataset
  from infer import inference
label_desc: Use image node_id 1 for calling a global function with example usage: data2tensor(batch_dict) and returns: feed_dict