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 call(
      self,
      inputs: types.NestedTensor,
      outer_rank: int,
      training: bool = False,
      mask: Optional[types.NestedTensor] = None,
  ) -> types.NestedTensor:
      if (
          inputs.dtype != self._sample_spec.dtype
      ):  # pytype: disable=attribute-error
          raise ValueError(
              "Inputs to TanhNormalProjectionNetwork must match the "
              "sample_spec.dtype."
          )
  
      if mask is not None:
          raise NotImplementedError(
              "TanhNormalProjectionNetwork does not yet implement action masking; "
              "got mask={}".format(mask)
          )
  
      # outer_rank is needed because the projection is not done on the raw
      # observations so getting the outer rank is hard as there is no spec to
      # compare to.
      batch_squash = network_utils.BatchSquash(outer_rank)
      inputs = batch_squash.flatten(inputs)
  
      means_and_stds = self._projection_layer(inputs, training=training)
      means, stds = tf.split(
          means_and_stds, num_or_size_splits=2, axis=-1
      )
      means = tf.reshape(
          means, [-1] + self._sample_spec.shape.as_list()
      )
      means = tf.cast(means, self._sample_spec.dtype)
  
      if self._std_transform is not None:
          stds = self._std_transform(stds)
      stds = tf.cast(stds, self._sample_spec.dtype)
  
      means = batch_squash.unflatten(means)
      stds = batch_squash.unflatten(stds)
  
      return (
          self.output_spec.build_distribution(
              loc=means, scale_diag=stds
          ),
          (),
      )
  
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 3 for calling the TanhNormalProjectionNetwork obj's underlying member method code with example usage: obj.call(inputs, outer_rank, training, mask) and returns: self,  