code: def _tensor_to_object(tensor, tensor_size):
      buf = tensor.detach().cpu().numpy().tobytes()[:tensor_size]
      res = pickle.loads(buf)
      assert res["protocol_version"] == PROTOCOL_VERSION
      return res["data"]
  
file_path: fastNLP/fastNLP/core/drivers/oneflow_driver/dist_utils.py
imports: import io
  import pickle
  import os
  from typing import Any, List
  from fastNLP.core.utils import apply_to_collection, get_oneflow_device
  from fastNLP.envs.imports import _NEED_IMPORT_ONEFLOW
  from fastNLP.envs.env import FASTNLP_NO_SYNC
label_desc: Use image node_id 4 for calling a global function with example usage: _tensor_to_object(tensor, tensor_size) and returns: res