class_docstr: Returns greedy samples of a given policy.
class_docstr_tok: ["Returns","greedy","samples","of","a","given","policy","."]
code: def _distribution(self, time_step, policy_state):
      def dist_fn(dist):
          try:
              greedy_action = dist.mode()
          except NotImplementedError:
              raise ValueError(
                  "Your network's distribution does not implement mode "
                  "making it incompatible with a greedy policy."
              ) from NotImplementedError
  
          return tfp.distributions.Deterministic(loc=greedy_action)
  
      distribution_step = self._wrapped_policy.distribution(
          time_step, policy_state
      )
      return policy_step.PolicyStep(
          tf.nest.map_structure(dist_fn, distribution_step.action),
          distribution_step.state,
          distribution_step.info,
      )
  
file_path: agents/tf_agents/policies/greedy_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
  import tensorflow_probability
  from tf_agents.policies import tf_policy
  from tf_agents.trajectories import policy_step
label_desc: Use image node_id 4 for calling the GreedyPolicy obj's underlying member method code with example usage: obj._distribution(time_step, policy_state) and returns: policy_step, tfp