class_docstr: Cast Data as integer (or integer array)
  
  Parameters
  ----------
  deterministic: bool
      if True, the data is rounded to the closest integer, if False, both surrounded
      integers can be sampled inversely proportionally to how close the actual value
      is from the integers.
  
  Example
  -------
  0.2 is cast to 0 in deterministic mode, and either 0 (80% chance) or 1 (20% chance) in
  non-deterministic mode
  
  Usage
  -----
  :code:`param = ng.ops.Int(deterministic=True)(ng.p.Array(shape=(3,)))`
class_docstr_tok: ["Cast","Data","as","integer","(","or","integer","array",")","Parameters","--","--","--","--","--","deterministic",":","bool","if","True",",","the","data","is","rounded","to","the","closest","integer",",","if","False",",","both","surrounded","integers","can","be","sampled","inversely","proportionally","to","how","close","the","actual","value","is","from","the","integers",".","Example","--","--","--","-","0.2","is","cast","to","0","in","deterministic","mode",",","and","either","0","(","80","%","chance",")","or","1","(","20","%","chance",")","in","non-deterministic","mode","Usage","--","--","-",":","code",":","`","param","=","ng.ops.Int","(","deterministic=True",")","(","ng.p.Array","(","shape=","(","3",",",")",")",")","`"]
code: def _layered_get_value(self) -> np.ndarray:
      if self._cache is not None:
          return self._cache
      bounds = self._layers[0].bounds  # type: ignore
      out = super()._layered_get_value()
      if not self.deterministic:
          out += self.random_state.rand(*out.shape) - 0.5
      out = np.round(out).astype(int)
      # make sure rounding does not reach beyond the bounds
      eps = 1e-12
      if bounds[0] is not None:
          out = np.maximum(_to_int(bounds[0] + 0.5 - eps), out)
      if bounds[1] is not None:
          out = np.minimum(_to_int(bounds[1] - 0.5 + eps), out)
      # return out
      self._cache = out
      return self._cache
  
imports: import uuid
  import copy
  import bisect
  from enum import Enum
  import numpy
  from nevergrad.common import errors
  import nevergrad.common.typing
label_desc: Use image node_id 3 for calling the Int obj's underlying member method code with example usage: obj._layered_get_value() and returns: self, self