@@ -218,6 +218,7 @@ class Layer(keras.src.backend.tensorflow.layer.TFLayer, keras.src.ops.operation.
218218 | initializer,
219219 | dtype=None,
220220 | trainable=True,
221+ | autocast=True,
221222 | regularizer=None,
222223 | constraint=None,
223224 | name=None
@@ -232,36 +233,41 @@ class Layer(keras.src.backend.tensorflow.layer.TFLayer, keras.src.ops.operation.
232233 | initializer=None,
233234 | dtype=None,
234235 | trainable=True,
236+ | autocast=True,
235237 | regularizer=None,
236238 | constraint=None,
239+ | aggregation='mean',
237240 | name=None
238241 | )
239242 | Add a weight variable to the layer.
240243 |
241244 | Args:
242- | shape: Shape tuple for the variable.
243- | Must be fully-defined (no `None` entries).
244- | Defaults to `()` (scalar) if unspecified.
245- | initializer: Initializer object to use to
246- | populate the initial variable value,
247- | or string name of a built-in initializer
248- | (e.g. `"random_normal"`). If unspecified,
249- | defaults to `"glorot_uniform"`
250- | for floating-point variables and to `"zeros"`
245+ | shape: Shape tuple for the variable. Must be fully-defined
246+ | (no `None` entries). Defaults to `()` (scalar) if unspecified.
247+ | initializer: Initializer object to use to populate the initial
248+ | variable value, or string name of a built-in initializer
249+ | (e.g. `"random_normal"`). If unspecified, defaults to
250+ | `"glorot_uniform"` for floating-point variables and to `"zeros"`
251251 | for all other types (e.g. int, bool).
252- | dtype: Dtype of the variable to create,
253- | e.g. `"float32"`. If unspecified,
254- | defaults to the layer's
255- | variable dtype (which itself defaults to
256- | `"float32"` if unspecified).
257- | trainable: Boolean, whether the variable should
258- | be trainable via backprop or whether its
259- | updates are managed manually.
260- | constraint: Contrainst object to call on the
261- | variable after any optimizer update,
262- | or string name of a built-in constraint.
263- | name: String name of the variable. Useful
264- | for debugging purposes.
252+ | dtype: Dtype of the variable to create, e.g. `"float32"`. If
253+ | unspecified, defaults to the layer's variable dtype
254+ | (which itself defaults to `"float32"` if unspecified).
255+ | trainable: Boolean, whether the variable should be trainable via
256+ | backprop or whether its updates are managed manually. Defaults
257+ | to `True`.
258+ | autocast: Boolean, whether to autocast layers variables when
259+ | accessing them. Defaults to `True`.
260+ | regularizer: Regularizer object to call to apply penalty on the
261+ | weight. These penalties are summed into the loss function
262+ | during optimization. Defaults to `None`.
263+ | constraint: Contrainst object to call on the variable after any
264+ | optimizer update, or string name of a built-in constraint.
265+ | Defaults to `None`.
266+ | aggregation: String, one of `'mean'`, `'sum'`,
267+ | `'only_first_replica'`. Annotates the variable with the type
268+ | of multi-replica aggregation to be used for this variable
269+ | when writing custom data parallel training loops.
270+ | name: String name of the variable. Useful for debugging purposes.
265271 |
266272 | build(self, input_shape)
267273 |
@@ -490,9 +496,4 @@ class Layer(keras.src.backend.tensorflow.layer.TFLayer, keras.src.ops.operation.
490496 | trainable
491497 | Settable boolean, whether this layer should be trainable or not.
492498 |
493- | ----------------------------------------------------------------------
494- | Data and other attributes defined here:
495- |
496- | __annotations__ = {}
497- |
498499
0 commit comments