code: def fill_hdf5_layer(
      tensor_names,
      state_dict,
      hdf5_file,
      hdf5_dataset_prefix,
      mapping_dict,
  ):
      for proto_name, ckpt_rule in mapping_dict.items():
          target_tensor = apply_rule(
              proto_name, ckpt_rule, tensor_names, state_dict
          )
          hdf5_file.create_dataset(
              hdf5_dataset_prefix + proto_name,
              data=target_tensor.flatten().tolist(),
          )
  
file_path: lightseq/lightseq/csrc/export/util.py
imports: import argparse
  from re import L
  import os
  import h5py
  import json
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: fill_hdf5_layer(tensor_names, state_dict, hdf5_file, hdf5_dataset_prefix, mapping_dict) without return types