parameters: (partition_param_list, param, partition_index,
                       complete_shape)
docstring: Merge partitial parameters to a complete one.
  
      Returns:
          None
  
      Examples:
          .. code-block:: python
  
              import numpy as np
              partition_param_list = [(np.array([[[1.11, 1.12]]]), [[0,1],[0,1],[0,2]])]
              param = np.array([[[1.13, 1.14]]])
              partition_index = [[0,1],[0,1],[2,4]]
  
              _merge_parameter(partition_param_list, param, partition_index)
              # partition_param_list: [(np.array([[[1.11, 1.12, 1.13, 1.14]]]), [[0,1],[0,1],[0,4]])]
docstring_summary: Merge partitial parameters to a complete one.
docstring_tokens: Merge partitial parameters to a complete one .
function: def _merge_parameter(partition_param_list, param, partition_index,
                       complete_shape):
      """
      Merge partitial parameters to a complete one.
  
      Returns:
          None
  
      Examples:
          .. code-block:: python
  
              import numpy as np
              partition_param_list = [(np.array([[[1.11, 1.12]]]), [[0,1],[0,1],[0,2]])]
              param = np.array([[[1.13, 1.14]]])
              partition_index = [[0,1],[0,1],[2,4]]
  
              _merge_parameter(partition_param_list, param, partition_index)
              # partition_param_list: [(np.array([[[1.11, 1.12, 1.13, 1.14]]]), [[0,1],[0,1],[0,4]])]
      """
      from .reshard import _compute_concat_info
  
      if len(partition_param_list) == 1:
          is_complete_data = True
          for idx, item in enumerate(partition_param_list[0][1]):
              if item[0] != 0 or item[1] != complete_shape[idx]:
                  is_complete_data = False
                  break
          if is_complete_data:
              return
  
      if not partition_param_list:
          partition_param_list.append((param, partition_index))
      else:
          i = 0
          while i < len(partition_param_list):
              concat_axis, first_order, new_partition = _compute_concat_info(
                  partition_param_list[i][1], partition_index)
              if concat_axis != -1:
                  if first_order == 0:
                      new_param = np.concatenate(
                          (partition_param_list[i][0], param), axis=concat_axis)
                  else:
                      new_param = np.concatenate(
                          (param, partition_param_list[i][0]), axis=concat_axis)
  
                  partition_param_list.pop(i)
                  _merge_parameter(partition_param_list, new_param, new_partition,
                                   complete_shape)
                  break
              i += 1
function_tokens: def _merge_parameter ( partition_param_list , param , partition_index , complete_shape ) : from . reshard import _compute_concat_info if len ( partition_param_list ) == 1 : is_complete_data = True for idx , item in enumerate ( partition_param_list [ 0 ] [ 1 ] ) : if item [ 0 ] != 0 or item [ 1 ] != complete_shape [ idx ] : is_complete_data = False break if is_complete_data : return if not partition_param_list : partition_param_list . append ( ( param , partition_index ) ) else : i = 0 while i < len ( partition_param_list ) : concat_axis , first_order , new_partition = _compute_concat_info ( partition_param_list [ i ] [ 1 ] , partition_index ) if concat_axis != - 1 : if first_order == 0 : new_param = np . concatenate ( ( partition_param_list [ i ] [ 0 ] , param ) , axis = concat_axis ) else : new_param = np . concatenate ( ( param , partition_param_list [ i ] [ 0 ] ) , axis = concat_axis ) partition_param_list . pop ( i ) _merge_parameter ( partition_param_list , new_param , new_partition , complete_shape ) break i += 1