class_docstr: A DQN Agent.
  
  Implements the DQN algorithm from
  
  "Human level control through deep reinforcement learning"
    Mnih et al., 2015
    https://deepmind.com/research/dqn/
  
  This agent also implements n-step updates. See "Rainbow: Combining
  Improvements in Deep Reinforcement Learning" by Hessel et al., 2017, for a
  discussion on its benefits: https://arxiv.org/abs/1710.02298
class_docstr_tok: ["A","DQN","Agent",".","Implements","the","DQN","algorithm","from","''","Human","level","control","through","deep","reinforcement","learning","''","Mnih","et","al.",",","2015","https",":","\/\/deepmind.com\/research\/dqn\/","This","agent","also","implements","n-step","updates",".","See","``","Rainbow",":","Combining","Improvements","in","Deep","Reinforcement","Learning","''","by","Hessel","et","al.",",","2017",",","for","a","discussion","on","its","benefits",":","https",":","\/\/arxiv.org\/abs\/1710.02298"]
docstr: Compute the q value of the next state for TD error computation.
  
  Args:
    next_time_steps: A batch of next timesteps
    info: PolicyStep.info that may be used by other agents inherited from
      dqn_agent.
  
  Returns:
    A tensor of Q values for the given next state.
code: def _compute_next_q_values(self, next_time_steps, info):
      """Compute the q value of the next state for TD error computation.
  
      Args:
        next_time_steps: A batch of next timesteps
        info: PolicyStep.info that may be used by other agents inherited from
          dqn_agent.
  
      Returns:
        A tensor of Q values for the given next state.
      """
      network_observation = next_time_steps.observation
  
      if self._observation_and_action_constraint_splitter is not None:
          (
              network_observation,
              _,
          ) = self._observation_and_action_constraint_splitter(
              network_observation
          )
  
      q_next_target, _ = self._target_q_network(
          network_observation, step_type=next_time_steps.step_type
      )
      next_target_q_values = (
          q_next_target[0]
          if isinstance(q_next_target, tuple)
          else q_next_target
      )
      batch_size = (
          next_target_q_values.shape[0]
          or tf.shape(next_target_q_values)[0]
      )
      dummy_state = self._target_greedy_policy.get_initial_state(
          batch_size
      )
      # Find the greedy actions using our target greedy policy. This ensures that
      # action constraints are respected and helps centralize the greedy logic.
      greedy_actions = self._target_greedy_policy.action(
          next_time_steps, dummy_state
      ).action
  
      # Handle action_spec.shape=(), and shape=(1,) by using the multi_dim_actions
      # param. Note: assumes len(tf.nest.flatten(action_spec)) == 1.
      multi_dim_actions = (
          tf.nest.flatten(self._action_spec)[0].shape.rank > 0
      )
      return common.index_with_actions(
          next_target_q_values,
          greedy_actions,
          multi_dim_actions=multi_dim_actions,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from typing import Optional, Text, cast
  import gin
  import tensorflow
  from tf_agents.agents import data_converter
  from tf_agents.agents import tf_agent
  from tf_agents.networks import network
  from tf_agents.networks import utils
  from tf_agents.policies import boltzmann_policy
  from tf_agents.policies import epsilon_greedy_policy
  from tf_agents.policies import greedy_policy
  from tf_agents.policies import q_policy
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import eager_utils
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 11 for calling the DqnAgent obj's underlying member method code with example usage: obj._compute_next_q_values(next_time_steps, info) and returns: common