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","."]
docstr: Output will be cast to integer(s) through deterministic rounding.
  
  Parameters
  ----------
  sigma: Array/Log or float
      The standard deviation of the mutation. If a Parameter is provided, it will replace the current
      value. If a float is provided, it will either replace a previous float value, or update the value
      of the Parameter.
  exponent: float
      exponent for the logarithmic mode. With the default sigma=1, using exponent=2 will perform
      x2 or /2 "on average" on the value at each mutation.
  
  Returns
  -------
  self
docstr_tok: ["Output","will","be","cast","to","integer","(","s",")","through","deterministic","rounding",".","Parameters","--","--","--","--","--","sigma",":","Array\/Log","or","float","The","standard","deviation","of","the","mutation",".","If","a","Parameter","is","provided",",","it","will","replace","the","current","value",".","If","a","float","is","provided",",","it","will","either","replace","a","previous","float","value",",","or","update","the","value","of","the","Parameter",".","exponent",":","float","exponent","for","the","logarithmic","mode",".","With","the","default","sigma=1",",","using","exponent=2","will","perform","x2","or","\/2","``","on","average","''","on","the","value","at","each","mutation",".","Returns","--","--","--","-","self"]
code: def set_mutation(
      self: D,
      sigma: tp.Optional[tp.Union[float, core.Parameter]] = None,
      exponent: tp.Optional[float] = None,
  ) -> D:
      """Output will be cast to integer(s) through deterministic rounding.
  
      Parameters
      ----------
      sigma: Array/Log or float
          The standard deviation of the mutation. If a Parameter is provided, it will replace the current
          value. If a float is provided, it will either replace a previous float value, or update the value
          of the Parameter.
      exponent: float
          exponent for the logarithmic mode. With the default sigma=1, using exponent=2 will perform
          x2 or /2 "on average" on the value at each mutation.
  
      Returns
      -------
      self
      """
      if sigma is not None:
          # just replace if an actual Parameter is provided as sigma, else update value (parametrized or not)
          if isinstance(sigma, core.Parameter) or isinstance(
              self.parameters._content["sigma"], core.Constant
          ):
              self.parameters._content["sigma"] = core.as_parameter(
                  sigma
              )
          else:
              self.sigma.value = sigma
      if exponent is not None:
          from . import _datalayers
  
          if exponent <= 0.0:
              raise ValueError(
                  "Only exponents strictly higher than 0.0 are allowed"
              )
          value = self.value
          layer = _datalayers.Exponent(base=exponent)
          layer._LEGACY = True
          self.add_layer(layer)
          _fix_legacy(self)
          try:
              self.value = value
          except ValueError as e:
              raise errors.NevergradValueError(
                  "Cannot convert to logarithmic mode with current non-positive value, please update it firstp."
              ) from e
      return self
  
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 8 for calling the Data obj's underlying member method code with example usage: obj.set_mutation(sigma, exponent) and returns: self