class_docstr: Array/scalar parameter
  
  Parameters
  ----------
  init: np.ndarray, or None
      initial value of the array (defaults to 0, with a provided shape)
  shape: tuple of ints, or None
      shape of the array, to be provided iff init is not provided
  lower: array, float or None
      minimum value
  upper: array, float or None
      maximum value
  mutable_sigma: bool
      whether the mutation standard deviation must mutate as well (for mutation based algorithms)
  
  Note
  ----
  - More specific behaviors can be obtained throught the following methods:
    set_bounds, set_mutation, set_integer_casting
  - if both lower and upper bounds are provided, sigma will be adapted so that the range spans 6 sigma.
    Also, if init is not provided, it will be set to the middle value.
class_docstr_tok: ["Array\/scalar","parameter","Parameters","--","--","--","--","--","init",":","np.ndarray",",","or","None","initial","value","of","the","array","(","defaults","to","0",",","with","a","provided","shape",")","shape",":","tuple","of","ints",",","or","None","shape","of","the","array",",","to","be","provided","iff","init","is","not","provided","lower",":","array",",","float","or","None","minimum","value","upper",":","array",",","float","or","None","maximum","value","mutable_sigma",":","bool","whether","the","mutation","standard","deviation","must","mutate","as","well","(","for","mutation","based","algorithms",")","Note","--","--","-","More","specific","behaviors","can","be","obtained","throught","the","following","methods",":","set_bounds",",","set_mutation",",","set_integer_casting","-","if","both","lower","and","upper","bounds","are","provided",",","sigma","will","be","adapted","so","that","the","range","spans","6","sigma",".","Also",",","if","init","is","not","provided",",","it","will","be","set","to","the","middle","value","."]
code: def __init__(
      self,
      *,
      init: tp.Optional[tp.ArrayLike] = None,
      shape: tp.Optional[tp.Tuple[int, ...]] = None,
      lower: tp.BoundValue = None,
      upper: tp.BoundValue = None,
      mutable_sigma: bool = False,
  ) -> None:
      super().__init__()
      sigma: tp.Any = np.array([1.0])
      # make sure either shape or
      if isinstance(lower, (list, tuple)):
          lower = np.array(lower, dtype=float)
      if isinstance(upper, (list, tuple)):
          upper = np.array(upper, dtype=float)
      if sum(x is None for x in [init, shape]) != 1:
          raise ValueError(
              'Exactly one of "init" or "shape" must be provided'
          )
      if init is not None:
          init = np.array(init, dtype=float, copy=False)
      else:
          assert isinstance(shape, (list, tuple)) and all(
              isinstance(n, int) for n in shape
          ), f"Incorrect shape: {shape} (type: {type(shape)})."
          init = np.zeros(shape, dtype=float)
          if lower is not None and upper is not None:
              init += (lower + upper) / 2.0
      self._value = init
      self.add_layer(_layering.ArrayCasting())
      # handle bounds
      num_bounds = sum(x is not None for x in (lower, upper))
      layer: tp.Any = None
      if num_bounds:
          from . import _datalayers
  
          layer = _datalayers.Bound(
              lower=lower,
              upper=upper,
              uniform_sampling=init is None and num_bounds == 2,
          )
          if num_bounds == 2:
              sigma = (layer.bounds[1] - layer.bounds[0]) / 6
      # set parameters
      sigma = sigma[0] if sigma.size == 1 else sigma
      if mutable_sigma:
          siginit = sigma
          # for the choice of the base:
          # cf Evolution Strategies, Hans-Georg Beyer (2007)
          # http://www.scholarpedia.org/article/Evolution_strategies
          # we want:
          # sigma *= exp(gaussian / sqrt(dim))
          base = float(np.exp(1.0 / np.sqrt(2 * init.size)))
          sigma = base ** (
              Array if isinstance(sigma, np.ndarray) else Scalar
          )(init=siginit, mutable_sigma=False)
          sigma.value = siginit
      self.parameters = Dict(sigma=sigma)
      self.parameters._ignore_in_repr = dict(sigma="1.0")
      if layer is not None:
          layer(self, inplace=True)
  
imports: import numpy
  import nevergrad.common.typing
  from nevergrad.common import errors
  from .None import _layering
  from .None import core
  from .container import Dict
  from .None import utils
label_desc: Use image node_id 1 to create a new Data object from inherited base classes: core with example: obj = Data()