You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tensorlayer/layers/lambda_layers.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -56,11 +56,11 @@ class Lambda(Layer):
56
56
Please avoid using Model.save() / Model.load() to save / load models that contain such Lambda layer. Instead, you may use Model.save_weights() / Model.load_weights() to save / load model weights.
57
57
Note: In this case, fn_weights should be a list, and then the trainable weights in this Lambda layer can be added into the weights of the whole model.
58
58
59
-
>>> a = [tf.Variable(1.0)]
59
+
>>> a = tf.Variable(1.0)
60
60
>>> def func(x):
61
-
>>> return x + a[0]
61
+
>>> return x + a
62
62
>>> x = tl.layers.Input([8, 3], name='input')
63
-
>>> y = tl.layers.Lambda(func, fn_weights=a, name='lambda')(x)
63
+
>>> y = tl.layers.Lambda(func, fn_weights=[a], name='lambda')(x)
64
64
65
65
66
66
Parametric case, merge other wrappers into TensorLayer:
0 commit comments