code: def parse_tensor_data(tensor_proto):
      try:
          from onnx.numpy_helper import to_array
      except ImportError:
          invalidInputError(
              False, "Onnx and protobuf need to be installed."
          )
      if len(tuple(tensor_proto.dims)) > 0:
          np_array = to_array(tensor_proto).reshape(
              tuple(tensor_proto.dims)
          )
      else:
          # If it is a scalar tensor
          np_array = np.array([to_array(tensor_proto)])
      return np_array
  
imports: import math
  import numpy
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 3 for calling a global function with example usage: parse_tensor_data(tensor_proto) and returns: np_array