def init_weight(weights, initializer, scale=1.0):
 if (initializer is None):
  initializer = HeNormal((1 / numpy.sqrt(2)))
 elif numpy.isscalar(initializer):
  initializer = Constant(initializer)
 elif isinstance(initializer, numpy.ndarray):
  initializer = Constant(initializer)
 assert callable(initializer)
 initializer(weights)
 weights *= scale

def init_weight ( weights , initializer , scale = 1.0 ) : if ( initializer is None ) : initializer = HeNormal ( ( 1 / numpy . sqrt ( 2 ) ) ) elif numpy . isscalar ( initializer ) : initializer = Constant ( initializer ) elif isinstance ( initializer , numpy . ndarray ) : initializer = Constant ( initializer ) assert callable ( initializer ) initializer ( weights ) weights *= scale
helper function for initialization of the weight tensor .