class_docstr: Generates a tanh-squashed MultivariateNormalDiag distribution.
  
  Note: Due to the nature of the `tanh` function, values near the spec bounds
  cannot be returned.
class_docstr_tok: ["Generates","a","tanh-squashed","MultivariateNormalDiag","distribution",".","Note",":","Due","to","the","nature","of","the","`","tanh","`","function",",","values","near","the","spec","bounds","can","not","be","returned","."]
code: def _output_distribution_spec(self, sample_spec, network_name):
      input_param_shapes = {
          "loc": sample_spec.shape,
          "scale_diag": sample_spec.shape,
      }
      input_param_spec = {  # pylint: disable=g-complex-comprehension
          name: tensor_spec.TensorSpec(
              shape=shape,
              dtype=sample_spec.dtype,
              name=network_name + "_" + name,
          )
          for name, shape in input_param_shapes.items()
      }
  
      def distribution_builder(*args, **kwargs):
          distribution = tfp.distributions.MultivariateNormalDiag(
              *args, **kwargs
          )
          return distribution_utils.scale_distribution_to_spec(
              distribution, sample_spec
          )
  
      return distribution_spec.DistributionSpec(
          distribution_builder,
          input_param_spec,
          sample_spec=sample_spec,
      )
  
file_path: agents/tf_agents/agents/sac/tanh_normal_projection_network.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Callable, Optional, Text
  import gin
  import tensorflow
  import tensorflow_probability
  from tf_agents.distributions import utils
  from tf_agents.networks import network
  from tf_agents.networks import utils
  from tf_agents.specs import distribution_spec
  from tf_agents.specs import tensor_spec
  from tf_agents.typing import types
label_desc: Use image node_id 2 for calling the TanhNormalProjectionNetwork obj's underlying member method code with example usage: obj._output_distribution_spec(sample_spec, network_name) and returns: distribution_spec, distribution_utils