raise AssertionError("The `fn` argument cannot be None")
with tf.compat.v1.variable_scope(name) as vs:
self.outputs = fn(self.inputs, **self.fn_args)
variables = tf.compat.v1.get_collection(TF_GRAPHKEYS_VARIABLES, scope=vs.name)
self._add_layers(self.outputs)
self._add_params(variables)
class ElementwiseLambda(Layer):
After Change
super(Lambda, self).__init__(name=name)
self.fn = fn
self._weights = fn_weights if fn_weights is not None else []
self.fn_args = fn_args if fn_args is not None else {}
try:
fn_name = repr(self.fn)