tf.keras.initializers.Ones

Initializer that generates tensors initialized to 1.

Inherits From: ones_initializer, Initializer

Used in the notebooks

Used in the guide

Also available via the shortcut function tf.keras.initializers.ones.

Examples:

# Standalone usage:
initializer = tf.keras.initializers.Ones()
values = initializer(shape=(2, 2))
# Usage in a Keras layer:
initializer = tf.keras.initializers.Ones()