code: def tensor_map_to_ndarray_map(tensor_map: TensorMap):
      ndarray_map = {}
      for k, v in tensor_map.items():
          if not isinstance(v, FloatTensor):
              invalidInputError(
                  False,
                  "tensor map element should be protobuf type FloatTensor",
              )
          dtype = "float32" if v.dtype is None else v.dtype
          ndarray_map[k] = np.array(v.tensor, dtype=dtype).reshape(
              v.shape
          )
      return ndarray_map
  
file_path: BigDL/python/ppml/src/bigdl/ppml/fl/nn/utils.py
imports: import logging
  from bigdl.ppml.utils.safepickle import SafePickle
  import stat
  import numpy
  from bigdl.ppml.fl.nn.generated.nn_service_pb2 import *
  from bigdl.ppml.fl.nn.generated.fl_base_pb2 import FloatTensor, TensorMap
  import numpy
  from bigdl.dllib.utils.log4Error import invalidInputError
  from bigdl.ppml.fl.nn.generated.fl_base_pb2 import FloatTensor, TensorMap
label_desc: Use image node_id 2 for calling a global function with example usage: tensor_map_to_ndarray_map(tensor_map) and returns: ndarray_map