class_docstr: This (abstract) class is a generic wrapper of OpenAI Gym env for policy evaluation.
  Attributes need to be override accordingly to have concrete working function.
  
  Attributes.
  ------------
  env_name: str
      Gym OpenAI environment name
  policy_dim: tuple
      Shape of the policy
  state_mean: list
      Average state values of multiple independent runs.
      Current implementations use values from https://github.com/modestyachts/ARS
  state_std: list
      Standard deviation of state values of multiple independent runs.
      Current implementations use values from https://github.com/modestyachts/ARS
  
  Parameters
  -----------
  num_rollouts: int
      number of independent runs.
  activation: str (default: 'tanh')
      activation function, only applicable when len(intermediate_layer_dim>) > 0
  deterministic_sim: bool (default: True)
      Deterministic when initial states are the same for all evaluations
  noise_level: float (default: 0.)
      Level (standard deviation) of noise applied to final action
  intermediate_layer_dim: tuple or None
      Shape of intermediate layers if exists else None
  layer_rescaling_coef: tuple or None
      Scaling coefficient of output layers
  states_normalization: bool (default: True)
      Normalize states with `state_mean` and `state_std`
  random_state: int or None
      random state for reproducibility in Gym environment.
code: def __init__(
      self,
      num_rollouts: int,
      activation: str = "tanh",
      intermediate_layer_dim: tp.Optional[tuple] = None,
      deterministic_sim: bool = True,
      noise_level: float = 0.0,
      states_normalization: bool = True,
      layer_rescaling_coef: tp.Optional[tuple] = None,
      random_state: tp.Optional[int] = None,
  ) -> None:
      if intermediate_layer_dim is not None:
          self.policy_dim = (self.policy_dim[0],) + intermediate_layer_dim + (self.policy_dim[1],)  # type: ignore
      list_parametrizations = [
          p.Array(shape=(a, b)).set_name(r"layer_{a}_{b}")
          for a, b in zip(self.policy_dim[:-1], self.policy_dim[1:])
      ]
      parametrization: p.Tuple = p.Tuple(
          *list_parametrizations
      ).set_name(self.env_name)
      super().__init__(self._simulate, parametrization)
      self.num_rollouts = num_rollouts
      self.random_state = random_state
      self.activation = activation
      self.states_normalization = states_normalization
      self.noise_level = noise_level
      self.deterministic_sim = deterministic_sim
      self.layer_rescaling_coef = layer_rescaling_coef
      if layer_rescaling_coef is None:
          self.layer_rescaling_coef = np.ones(len(self.policy_dim) - 1)  # type: ignore
      self.add_descriptors(
          num_rollouts=num_rollouts,
          intermediate_layer_dim=intermediate_layer_dim,
          activation=activation,
          states_normalization=states_normalization,
          noise_level=self.noise_level,
          deterministic_sim=deterministic_sim,
      )
      # This was interesting, but the noise level in mujoco is not sufficient for making this flag useful:
      # if self.noise_level > 0.0 or not deterministic_sim:
      #    self.parametrization.function.deterministic = False
      self._descriptors.pop("random_state", None)
  
imports: import numpy
  import gym
  import nevergrad.common.typing
  from nevergrad.parametrization import parameter
  from ..None import base
  from .mujoco import GenericMujocoEnv
label_desc: Use image node_id 1 to create a new BaseFunction object from inherited base classes: base with example: obj = BaseFunction(num_rollouts, activation, intermediate_layer_dim, deterministic_sim, noise_level, states_normalization, layer_rescaling_coef, random_state)