class_docstr: Returns boltzmann samples of a given policy.
  
  The wrapped policy must expose a distribution parameterized by logits.
class_docstr_tok: ["Returns","boltzmann","samples","of","a","given","policy",".","The","wrapped","policy","must","expose","a","distribution","parameterized","by","logits","."]
docstr: Builds a BoltzmannPolicy wrapping the given policy.
  
  Args:
    policy: A policy implementing the tf_policy.TFPolicy interface, using a
      distribution parameterized by logits.
    temperature: Tensor or function that returns the temperature for sampling
      when `action` is called. This parameter applies when the action spec is
      discrete. If the temperature is close to 0.0 this is equivalent to
      calling `tf.argmax` on the output of the network.
    name: The name of this policy. All variables in this module will fall
      under that name. Defaults to the class name.
docstr_tok: ["Builds","a","BoltzmannPolicy","wrapping","the","given","policy",".","Args",":","policy",":","A","policy","implementing","the","tf_policy.TFPolicy","interface",",","using","a","distribution","parameterized","by","logits",".","temperature",":","Tensor","or","function","that","returns","the","temperature","for","sampling","when","`","action","`","is","called",".","This","parameter","applies","when","the","action","spec","is","discrete",".","If","the","temperature","is","close","to","0.0","this","is","equivalent","to","calling","`","tf.argmax","`","on","the","output","of","the","network",".","name",":","The","name","of","this","policy",".","All","variables","in","this","module","will","fall","under","that","name",".","Defaults","to","the","class","name","."]
code: def __init__(
      self,
      policy: tf_policy.TFPolicy,
      temperature: types.FloatOrReturningFloat = 1.0,
      name: Optional[Text] = None,
  ):
      """Builds a BoltzmannPolicy wrapping the given policy.
  
      Args:
        policy: A policy implementing the tf_policy.TFPolicy interface, using a
          distribution parameterized by logits.
        temperature: Tensor or function that returns the temperature for sampling
          when `action` is called. This parameter applies when the action spec is
          discrete. If the temperature is close to 0.0 this is equivalent to
          calling `tf.argmax` on the output of the network.
        name: The name of this policy. All variables in this module will fall
          under that name. Defaults to the class name.
      """
      super(BoltzmannPolicy, self).__init__(
          policy.time_step_spec,
          policy.action_spec,
          policy.policy_state_spec,
          policy.info_spec,
          emit_log_probability=policy.emit_log_probability,
          clip=False,
          name=name,
      )
      self._temperature = temperature
      self._wrapped_policy = policy
  
file_path: agents/tf_agents/policies/boltzmann_policy.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Optional, Text
  import gin
  import tensorflow
  from tf_agents.policies import tf_policy
  from tf_agents.typing import types
label_desc: Use image node_id 1 to create a new BoltzmannPolicy object from inherited base classes: tf_policy with example: obj = BoltzmannPolicy(policy, temperature, name)