code: def ndarray_map_to_tensor_map(array_map: dict):
      tensor_map = {}
      for k, v in array_map.items():
          if not isinstance(v, np.ndarray):
              invalidInputError(
                  False, "ndarray map element should be Numpy ndarray"
              )
          tensor_map[k] = FloatTensor(
              tensor=v.flatten().tolist(),
              shape=v.shape,
              dtype=str(v.dtype),
          )
      return TensorMap(tensorMap=tensor_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 1 for calling a global function with example usage: ndarray_map_to_tensor_map(array_map) and returns: TensorMap