class_docstr: Q net with categorical scalar action space.
  
  Args:
      action_space (optional): An instance of :class:`~texar.tf.agents.Space`
          specifying the action space. If not given, an discrete action space
          `[0, high]` is created with `high` specified in :attr:`hparams`.
      network (optional): A network that takes in state and returns
          Q values. For example, an instance of subclass
          of :class:`~texar.tf.modules.FeedForwardNetworkBase`. If `None`,
          a network is created as specified in :attr:`hparams`.
      network_kwargs (dict, optional): Keyword arguments for network
          constructor.
          Note that the `hparams` argument for network
          constructor is specified in the "network_hparams" field of
          :attr:`hparams` and should not be included in `network_kwargs`.
          Ignored if :attr:`network` is given.
      hparams (dict or HParams, optional): Hyperparameters. Missing
          hyperparamerter will be set to default values. See
          :meth:`default_hparams` for the hyperparameter sturcture and
          default values.
  
  .. document private functions
  .. automethod:: _build
class_docstr_tok: ["Q","net","with","categorical","scalar","action","space",".","Args",":","action_space","(","optional",")",":","An","instance","of",":","class",":","`","~texar.tf.agents.Space","`","specifying","the","action","space",".","If","not","given",",","an","discrete","action","space","`","[","0",",","high","]","`","is","created","with","`","high","`","specified","in",":","attr",":","`","hparams","`",".","network","(","optional",")",":","A","network","that","takes","in","state","and","returns","Q","values",".","For","example",",","an","instance","of","subclass","of",":","class",":","`","~texar.tf.modules.FeedForwardNetworkBase","`",".","If","`","None","`",",","a","network","is","created","as","specified","in",":","attr",":","`","hparams","`",".","network_kwargs","(","dict",",","optional",")",":","Keyword","arguments","for","network","constructor",".","Note","that","the","`","hparams","`","argument","for","network","constructor","is","specified","in","the","``","network_hparams","''","field","of",":","attr",":","`","hparams","`","and","should","not","be","included","in","`","network_kwargs","`",".","Ignored","if",":","attr",":","`","network","`","is","given",".","hparams","(","dict","or","HParams",",","optional",")",":","Hyperparameters",".","Missing","hyperparamerter","will","be","set","to","default","values",".","See",":","meth",":","`","default_hparams","`","for","the","hyperparameter","sturcture","and","default","values",".","..","document","private","functions","..","automethod",":",":","_build"]
docstr: Takes in states and outputs Q values.
  
  Args:
      inputs: Inputs to the Q net with the first dimension
          the batch dimension.
      mode (optional): A tensor taking value in
          :tf_main:`tf.estimator.ModeKeys <estimator/ModeKeys>`, including
          `TRAIN`, `EVAL`, and `PREDICT`. If `None`,
          :func:`texar.tf.global_mode` is used.
  
  Returns
      A `dict` including fields `"qvalues"`.
      where
  
      - **"qvalues"**: A Tensor of shape             `[batch_size] + action_space size` containing Q values of all            possible actions.
docstr_tok: ["Takes","in","states","and","outputs","Q","values",".","Args",":","inputs",":","Inputs","to","the","Q","net","with","the","first","dimension","the","batch","dimension",".","mode","(","optional",")",":","A","tensor","taking","value","in",":","tf_main",":","`","tf.estimator.ModeKeys","<","estimator\/ModeKeys",">","`",",","including","`","TRAIN","`",",","`","EVAL","`",",","and","`","PREDICT","`",".","If","`","None","`",",",":","func",":","`","texar.tf.global_mode","`","is","used",".","Returns","A","`","dict","`","including","fields","`","``","qvalues","''","`",".","where","-","*","*","''","qvalues","''","*","*",":","A","Tensor","of","shape","`","[","batch_size","]","+","action_space","size","`","containing","Q","values","of","all","possible","actions","."]
code: def _build(self, inputs, mode=None):
      """Takes in states and outputs Q values.
  
          Args:
              inputs: Inputs to the Q net with the first dimension
                  the batch dimension.
              mode (optional): A tensor taking value in
                  :tf_main:`tf.estimator.ModeKeys <estimator/ModeKeys>`, including
                  `TRAIN`, `EVAL`, and `PREDICT`. If `None`,
                  :func:`texar.tf.global_mode` is used.
  
          Returns
              A `dict` including fields `"qvalues"`.
              where
  
              - **"qvalues"**: A Tensor of shape \
              `[batch_size] + action_space size` containing Q values of all\
              possible actions.
          """
      outputs = {"qvalues": self._network(inputs, mode=mode)}
  
      if not self._built:
          self._add_internal_trainable_variables()
          self._add_trainable_variable(
              self._network.trainable_variables
          )
          self._built = True
  
      return outputs
  
file_path: texar/texar/tf/modules/qnets/qnets.py
imports: import numpy
  import tensorflow
  from texar.tf.module_base import ModuleBase
  from texar.tf.agents.agent_utils import Space
  from texar.tf.utils import utils
label_desc: Use image node_id 4 for calling the CategoricalQNet obj's underlying member method code with example usage: obj._build(inputs, mode) and returns: outputs