def set_all_param_values(layer, values, **tags):
 params = get_all_params(layer, **tags)
 if (len(params) != len(values)):
  raise ValueError(('mismatch: got %d values to set %d parameters' % (len(values), len(params))))
 for (p, v) in zip(params, values):
  if (p.get_value().shape != v.shape):
   raise ValueError(('mismatch: parameter has shape %r but value to set has shape %r' % (p.get_value().shape, v.shape)))
  else:
   p.set_value(v)

def set_all_param_values ( layer , values , ** tags ) : params = get_all_params ( layer , ** tags ) if ( len ( params ) != len ( values ) ) : raise ValueError ( ( 'mismatch: got %d values to set %d parameters' % ( len ( values ) , len ( params ) ) ) ) for ( p , v ) in zip ( params , values ) : if ( p . get_value ( ) . shape != v . shape ) : raise ValueError ( ( 'mismatch: parameter has shape %r but value to set has shape %r' % ( p . get_value ( ) . shape , v . shape ) ) ) else : p . set_value ( v )
given a list of numpy arrays .