class_docstr: Sampling-based super-net training but using an RL agent to control the sampling.
  
  The default implementation for :class:`~nni.nas.strategy.ENAS`.
  
  See Also
  --------
  nni.nas.strategy.ENAS
  RandomSamplingLightningModule
code: def set_model(self, model: ModelSpace) -> None:
      if not isinstance(model, ModelSpace):
          raise TypeError("ModelSpace is required for ENAS.")
  
      from nni.nas.strategy._rl_impl import TuningTrajectoryGenerator
  
      self._generator = TuningTrajectoryGenerator(model, self.policy_fn)
  
      if self.replay_buffer_size is None:
          # Refresh the replay buffer every time the model is updated.
          replay_buffer_size = (
              self._generator.expected_trajectory_length
              * self.batches_per_update
          )
      else:
          replay_buffer_size = self.replay_buffer_size
  
      self._replay_buffer = ReplayBuffer(replay_buffer_size)
      self._policy = self._generator.policy
  
      return super().set_model(model)
  
imports: from __future__ import annotations
  import warnings
  import logging
  from typing import Any, Callable, TYPE_CHECKING
  import pytorch_lightning
  import torch
  from nni.mutable import Sample
  from nni.nas.nn.pytorch import ModelSpace
  from .base_lightning import BaseOneShotLightningModule
  from .profiler import ProfilerPenalty, ExpectationProfilerPenalty, SampleProfilerPenalty
label_desc: Use image node_id 4 for calling the EnasLightningModule obj's underlying member method code with example usage: obj.set_model(model) and returns: super