original_docstring: 
      Imitates filters pruning by removing `pruning_rate` percent of output filters in each pruning group
      and updating corresponding input channels number in `pruning_groups_next_nodes` nodes.
  
      :param pruning_groups: A list of pruning groups.
      :param pruning_rate: Target pruning rate.
      :param full_input_channels:  A dictionary of input channels number in original model.
      :param full_output_channels: A dictionary of output channels number in original model.
      :param pruning_groups_next_nodes: A dictionary of next nodes of each pruning group.
      :return Dictionary of new input channels number {node_name: channels_num}
      :return Dictionary of new output channels number {node_name: channels_num}
      
docstring: Imitates filters pruning by removing `pruning_rate` percent of output filters in each pruning group
  and updating corresponding input channels number in `pruning_groups_next_nodes` nodes.
  
  :param pruning_groups: A list of pruning groups.
  :param pruning_rate: Target pruning rate.
  :param full_input_channels:  A dictionary of input channels number in original model.
  :param full_output_channels: A dictionary of output channels number in original model.
  :param pruning_groups_next_nodes: A dictionary of next nodes of each pruning group.
  :return Dictionary of new input channels number {node_name: channels_num}
  :return Dictionary of new output channels number {node_name: channels_num}
docstring_tokens: Imitates filters pruning by removing ` pruning_rate ` percent of output filters in each pruning group and updating corresponding input channels number in ` pruning_groups_next_nodes ` nodes . : param pruning_groups : A list of pruning groups . : param pruning_rate : Target pruning rate . : param full_input_channels : A dictionary of input channels number in original model . : param full_output_channels : A dictionary of output channels number in original model . : param pruning_groups_next_nodes : A dictionary of next nodes of each pruning group . : return Dictionary of new input channels number { node_name : channels_num } : return Dictionary of new output channels number { node_name : channels_num }
code: def calculate_in_out_channels_in_uniformly_pruned_model(pruning_groups: List[Cluster[PrunedLayerInfoBase]],
                                                          pruning_rate: float,
                                                          full_input_channels: Dict[str, int],
                                                          full_output_channels: Dict[str, int],
                                                          pruning_groups_next_nodes: Dict[int, List[str]]):
      """
      Imitates filters pruning by removing `pruning_rate` percent of output filters in each pruning group
      and updating corresponding input channels number in `pruning_groups_next_nodes` nodes.
  
      :param pruning_groups: A list of pruning groups.
      :param pruning_rate: Target pruning rate.
      :param full_input_channels:  A dictionary of input channels number in original model.
      :param full_output_channels: A dictionary of output channels number in original model.
      :param pruning_groups_next_nodes: A dictionary of next nodes of each pruning group.
      :return Dictionary of new input channels number {node_name: channels_num}
      :return Dictionary of new output channels number {node_name: channels_num}
      """
      tmp_in_channels = full_input_channels.copy()
      tmp_out_channels = full_output_channels.copy()
  
      for group in pruning_groups:
          layer_name = group.elements[0].node_name
          assert all(tmp_out_channels[layer_name] == tmp_out_channels[node.node_name] for node in
                     group.elements)
          # Prune all nodes in cluster (by output channels)
          old_out_channels = full_output_channels[layer_name]
          num_of_sparse_elems = get_rounded_pruned_element_number(old_out_channels, pruning_rate)
          new_out_channels_num = old_out_channels - num_of_sparse_elems
  
          for minfo in group.elements:
              tmp_out_channels[minfo.node_name] = new_out_channels_num
  
          # Prune in_channels in all next nodes of cluster
          for node_name in pruning_groups_next_nodes[group.id]:
              tmp_in_channels[node_name] -= num_of_sparse_elems
  
      return tmp_in_channels, tmp_out_channels
code_tokens: def calculate_in_out_channels_in_uniformly_pruned_model ( pruning_groups : List [ Cluster [ PrunedLayerInfoBase ] ] , pruning_rate : float , full_input_channels : Dict [ str , int ] , full_output_channels : Dict [ str , int ] , pruning_groups_next_nodes : Dict [ int , List [ str ] ] ) : tmp_in_channels = full_input_channels . copy ( ) tmp_out_channels = full_output_channels . copy ( ) for group in pruning_groups : layer_name = group . elements [ 0 ] . node_name assert all ( tmp_out_channels [ layer_name ] == tmp_out_channels [ node . node_name ] for node in group . elements ) old_out_channels = full_output_channels [ layer_name ] num_of_sparse_elems = get_rounded_pruned_element_number ( old_out_channels , pruning_rate ) new_out_channels_num = old_out_channels - num_of_sparse_elems for minfo in group . elements : tmp_out_channels [ minfo . node_name ] = new_out_channels_num for node_name in pruning_groups_next_nodes [ group . id ] : tmp_in_channels [ node_name ] -= num_of_sparse_elems return tmp_in_channels , tmp_out_channels
short_docstring: Imitates filters pruning by removing `pruning_rate` percent of output filters in each pruning group
  and updating corresponding input channels number in `pruning_groups_next_nodes` nodes.
short_docstring_tokens: Imitates filters pruning by removing ` pruning_rate ` percent of output filters in each pruning group and updating corresponding input channels number in ` pruning_groups_next_nodes ` nodes .
comment: """
      Imitates filters pruning by removing `pruning_rate` percent of output filters in each pruning group
      and updating corresponding input channels number in `pruning_groups_next_nodes` nodes.
  
      :param pruning_groups: A list of pruning groups.
      :param pruning_rate: Target pruning rate.
      :param full_input_channels:  A dictionary of input channels number in original model.
      :param full_output_channels: A dictionary of output channels number in original model.
      :param pruning_groups_next_nodes: A dictionary of next nodes of each pruning group.
      :return Dictionary of new input channels number {node_name: channels_num}
      :return Dictionary of new output channels number {node_name: channels_num}
      """$SEP$# Prune all nodes in cluster (by output channels)$SEP$# Prune in_channels in all next nodes of cluster