docstr: Run a step leaning of the model
  
  :return: ([float], [float], [int64], [float], [float], [bool], [float])
           encoded observation, observations, actions, rewards, mus, dones, masks
docstr_tok: ["Run","a","step","leaning","of","the","model",":","return",":","(","[","float","]",",","[","float","]",",","[","int64","]",",","[","float","]",",","[","float","]",",","[","bool","]",",","[","float","]",")","encoded","observation",",","observations",",","actions",",","rewards",",","mus",",","dones",",","masks"]
code: def _run(self):
      """
      Run a step leaning of the model
  
      :return: ([float], [float], [int64], [float], [float], [bool], [float])
               encoded observation, observations, actions, rewards, mus, dones, masks
      """
      enc_obs = [self.obs]
      mb_obs, mb_actions, mb_mus, mb_dones, mb_rewards = (
          [],
          [],
          [],
          [],
          [],
      )
      for _ in range(self.n_steps):
          actions, _, states, _ = self.model.step(
              self.obs, self.states, self.dones
          )
          mus = self.model.proba_step(self.obs, self.states, self.dones)
          mb_obs.append(np.copy(self.obs))
          mb_actions.append(actions)
          mb_mus.append(mus)
          mb_dones.append(self.dones)
          clipped_actions = actions
          # Clip the actions to avoid out of bound error
          if isinstance(self.env.action_space, Box):
              clipped_actions = np.clip(
                  actions,
                  self.env.action_space.low,
                  self.env.action_space.high,
              )
          obs, rewards, dones, _ = self.env.step(clipped_actions)
  
          self.model.num_timesteps += self.n_envs
  
          if self.callback is not None:
              # Abort training early
              self.callback.update_locals(locals())
              if self.callback.on_step() is False:
                  self.continue_training = False
                  # Return dummy values
                  return [None] * 7
  
          # states information for statefull models like LSTM
          self.states = states
          self.dones = dones
          self.obs = obs
          mb_rewards.append(rewards)
          enc_obs.append(obs)
      mb_obs.append(np.copy(self.obs))
      mb_dones.append(self.dones)
  
      enc_obs = np.asarray(enc_obs, dtype=self.obs_dtype).swapaxes(1, 0)
      mb_obs = np.asarray(mb_obs, dtype=self.obs_dtype).swapaxes(1, 0)
      mb_actions = np.asarray(mb_actions, dtype=np.int64).swapaxes(1, 0)
      mb_rewards = np.asarray(mb_rewards, dtype=np.float32).swapaxes(
          1, 0
      )
      mb_mus = np.asarray(mb_mus, dtype=np.float32).swapaxes(1, 0)
      mb_dones = np.asarray(mb_dones, dtype=np.bool).swapaxes(1, 0)
  
      mb_masks = mb_dones  # Used for statefull models like LSTM's to mask state when done
      mb_dones = mb_dones[
          :, 1:
      ]  # Used for calculating returns. The dones array is now aligned with rewards
  
      # shapes are now [nenv, nsteps, []]
      # When pulling from buffer, arrays will now be reshaped in place, preventing a deep copy.
  
      return (
          enc_obs,
          mb_obs,
          mb_actions,
          mb_rewards,
          mb_mus,
          mb_dones,
          mb_masks,
      )
  
imports: import time
  import warnings
  import numpy
  import tensorflow
  from gym.spaces import Discrete, Box
  from collections import deque
  from stable_baselines import logger
  from stable_baselines.common.schedules import Scheduler
  from stable_baselines.common.tf_util import batch_to_seq, seq_to_batch, check_shape, avg_norm, gradient_add, q_explained_variance, total_episode_reward_logger
  from stable_baselines.acer.buffer import Buffer
  from stable_baselines.common import ActorCriticRLModel, tf_util, SetVerbosity, TensorboardWriter
  from stable_baselines.common.runners import AbstractEnvRunner
  from stable_baselines.common.policies import ActorCriticPolicy, RecurrentActorCriticPolicy
label_desc: Use image node_id 2 for calling the _Runner obj's underlying member method code with example usage: obj._run() and returns: enc_obs,  mb_obs,  mb_actions,  mb_rewards,  mb_mus,  mb_dones,  mb_masks, unknown