class_docstr: Constant initializer which always returns the same value.
  
  Parameters
  ----------
  value
  
  Examples
  --------
  
  >>> from river import optim
  
  >>> init = optim.initializers.Constant(value=3.14)
  
  >>> init(shape=1)
  3.14
  
  >>> init(shape=2)
  array([3.14, 3.14])
class_docstr_tok: ["Constant","initializer","which","always","returns","the","same","value",".","Parameters","--","--","--","--","--","value","Examples","--","--","--","--",">",">",">","from","river","import","optim",">",">",">","init","=","optim.initializers.Constant","(","value=3.14",")",">",">",">","init","(","shape=1",")","3.14",">",">",">","init","(","shape=2",")","array","(","[","3.14",",","3.14","]",")"]
code: def __call__(self, shape=1):
      return (
          np.full(shape, self.value, dtype=float)
          if shape != 1
          else self.value
      )
  
file_path: river/river/optim/initializers.py
imports: from __future__ import annotations
  import numpy
  from river.optim.base import Initializer
label_desc: Use image node_id 2 for calling the Constant obj's underlying member method code with example usage: obj.__call__(shape) and returns: unknown