parameters: (layer, c)
docstring: Recursive function to gather weight rescaling updates when the constant is the same for all layers.
docstring_summary: Recursive function to gather weight rescaling updates when the constant is the same for all layers.
docstring_tokens: Recursive function to gather weight rescaling updates when the constant is the same for all layers .
function: def gather_rescaling_updates(layer, c):
      """
      Recursive function to gather weight rescaling updates when the constant is the same for all layers.
      """
      if isinstance(layer, InputLayer) or isinstance(layer, Input2DLayer):
          return []
      elif isinstance(layer, ConcatenateLayer):
          return sum([gather_rescaling_updates(i, c) for i in layer.input_layers], [])
      else:
          if hasattr(layer, 'rescaling_updates'):
              updates = layer.rescaling_updates(c)
          else:
              updates = []
          return updates + gather_rescaling_updates(layer.input_layer, c)
function_tokens: def gather_rescaling_updates ( layer , c ) : if isinstance ( layer , InputLayer ) or isinstance ( layer , Input2DLayer ) : return [ ] elif isinstance ( layer , ConcatenateLayer ) : return sum ( [ gather_rescaling_updates ( i , c ) for i in layer . input_layers ] , [ ] ) else : if hasattr ( layer , 'rescaling_updates' ) : updates = layer . rescaling_updates ( c ) else : updates = [ ] return updates + gather_rescaling_updates ( layer . input_layer , c )