parameters: (weight_load_dir)
return_statement: return param_mat
docstring: load weights.
  
      Args:
          weight_load_dir (str): The weight(ckpt) file directory to be load.
docstring_summary: load weights.
docstring_tokens: load weights .
function: def _load_weights(weight_load_dir):
      """
      load weights.
  
      Args:
          weight_load_dir (str): The weight(ckpt) file directory to be load.
      """
      param_mat = None
      weight_file_list = os.listdir(weight_load_dir)
      for file in weight_file_list:
          if not file.endswith('.ckpt'):
              continue
          file_path = os.path.join(weight_load_dir, file)
          param_dict = load_checkpoint(file_path)
          param = None
          for _, value in param_dict.items():
              if param is None:
                  param = value.asnumpy().reshape((1, -1))
              else:
                  param = np.hstack((param, value.asnumpy().reshape((1, -1))))
          if param_mat is None:
              param_mat = param
          else:
              param_mat = np.vstack((param_mat, param))
      return param_mat
function_tokens: def _load_weights ( weight_load_dir ) : param_mat = None weight_file_list = os . listdir ( weight_load_dir ) for file in weight_file_list : if not file . endswith ( '.ckpt' ) : continue file_path = os . path . join ( weight_load_dir , file ) param_dict = load_checkpoint ( file_path ) param = None for _ , value in param_dict . items ( ) : if param is None : param = value . asnumpy ( ) . reshape ( ( 1 , - 1 ) ) else : param = np . hstack ( ( param , value . asnumpy ( ) . reshape ( ( 1 , - 1 ) ) ) ) if param_mat is None : param_mat = param else : param_mat = np . vstack ( ( param_mat , param ) ) return param_mat