code: def group_weights(weights):
      """
      Group each layer weights together, initially all weights are dict of 'layer_name/layer_var': np.array
  
      Example:
          input:  {
                      ...: ...
                      'conv2d/kernel': <np.array>,
                      'conv2d/bias': <np.array>,
                      ...: ...
                  }
          output: [..., [...], [<conv2d/kernel-weights>, <conv2d/bias-weights>], [...], ...]
  
      """
  
      out_weights = []
  
      previous_layer_name = ""
      group = []
  
      for k, v in weights.items():
          layer_name = "/".join(k.split("/")[:-1])
  
          if layer_name == previous_layer_name:
              group.append(v)
          else:
              if group:
                  out_weights.append(group)
  
              group = [v]
              previous_layer_name = layer_name
  
      out_weights.append(group)
      return out_weights
  
file_path: efficientnet/scripts/load_efficientnet.py
imports: import argparse
  import sys
  import numpy
  import tensorflow
  import efficientnet.keras
  from keras.layers import BatchNormalization, Conv2D, Dense
label_desc: Use image node_id 2 for calling a global function with example usage: group_weights(weights) and returns: out_weights