class_docstr: Initializer that generates tensors initialized to 1.
  
  Also available via the shortcut function `ones`.
  
  Examples:
  
  >>> # Standalone usage:
  >>> initializer = Ones()
  >>> values = initializer(shape=(2, 2))
  
  >>> # Usage in a Keras layer:
  >>> initializer = Ones()
  >>> layer = Dense(3, kernel_initializer=initializer)
class_docstr_tok: ["Initializer","that","generates","tensors","initialized","to","1",".","Also","available","via","the","shortcut","function","`","ones","`",".","Examples",":",">",">",">","#","Standalone","usage",":",">",">",">","initializer","=","Ones","(",")",">",">",">","values","=","initializer","(","shape=","(","2",",","2",")",")",">",">",">","#","Usage","in","a","Keras","layer",":",">",">",">","initializer","=","Ones","(",")",">",">",">","layer","=","Dense","(","3",",","kernel_initializer=initializer",")"]
docstr: Returns a tensor object initialized as specified by the initializer.
  
  Args:
      shape: Shape of the tensor.
      dtype: Optional dtype of the tensor. Only numeric or boolean dtypes
          are supported. If not specified, `keras.backend.floatx()`
          is used, which default to `float32` unless you configured it
          otherwise (via `keras.backend.set_floatx(float_dtype)`).
docstr_tok: ["Returns","a","tensor","object","initialized","as","specified","by","the","initializer",".","Args",":","shape",":","Shape","of","the","tensor",".","dtype",":","Optional","dtype","of","the","tensor",".","Only","numeric","or","boolean","dtypes","are","supported",".","If","not","specified",",","`","keras.backend.floatx","(",")","`","is","used",",","which","default","to","`","float32","`","unless","you","configured","it","otherwise","(","via","`","keras.backend.set_floatx","(","float_dtype",")","`",")","."]
code: def __call__(self, shape, dtype=None):
      """Returns a tensor object initialized as specified by the initializer.
  
      Args:
          shape: Shape of the tensor.
          dtype: Optional dtype of the tensor. Only numeric or boolean dtypes
              are supported. If not specified, `keras.backend.floatx()`
              is used, which default to `float32` unless you configured it
              otherwise (via `keras.backend.set_floatx(float_dtype)`).
      """
      dtype = standardize_dtype(dtype)
      return ops.ones(shape, dtype=dtype)
  
imports: from keras import ops
  from keras.api_export import keras_export
  from keras.backend import standardize_dtype
  from keras.initializers.initializer import Initializer
  from keras.saving import serialization_lib
label_desc: Use image node_id 1 for calling the Ones obj's underlying member method code with example usage: obj.__call__(shape, dtype) and returns: ops