class_docstr: A simple vector decoder to reproduce non-image (1D vector) observations.
  
  Wraps an MLP for mean parameter computations and a Gaussian distribution,
  from which we then sample using these mean values and a fixed stddev of 1.0.
docstr: Performs a forward pass through the vector encoder.
  
  Args:
      h: The deterministic hidden state of the sequence model. [B, dim(h)].
      z: The stochastic discrete representations of the original
          observation input. [B, num_categoricals, num_classes].
docstr_tok: ["Performs","a","forward","pass","through","the","vector","encoder",".","Args",":","h",":","The","deterministic","hidden","state","of","the","sequence","model",".","[","B",",","dim","(","h",")","]",".","z",":","The","stochastic","discrete","representations","of","the","original","observation","input",".","[","B",",","num_categoricals",",","num_classes","]","."]
code: def call(self, h, z):
      """Performs a forward pass through the vector encoder.
  
      Args:
          h: The deterministic hidden state of the sequence model. [B, dim(h)].
          z: The stochastic discrete representations of the original
              observation input. [B, num_categoricals, num_classes].
      """
      # Flatten last two dims of z.
      assert len(z.shape) == 3
      z_shape = tf.shape(z)
      z = tf.reshape(z, shape=(z_shape[0], -1))
      assert len(z.shape) == 2
      out = tf.concat([h, z], axis=-1)
      out.set_shape(
          [
              None,
              (
                  get_num_z_categoricals(self.model_size)
                  * get_num_z_classes(self.model_size)
                  + get_gru_units(self.model_size)
              ),
          ]
      )
      # Send h-cat-z through MLP to get mean values of diag gaussian.
      loc = self.mlp(out)
  
      # Return only the predicted observations (mean, no sample).
      return loc
  
file_path: ray/python/ray/rllib/algorithms/dreamerv3/tf/models/components/vector_decoder.py
imports: from typing import Optional
  import gymnasium
  from ray.rllib.algorithms.dreamerv3.tf.models.components.mlp import MLP
  from ray.rllib.algorithms.dreamerv3.utils import get_gru_units, get_num_z_categoricals, get_num_z_classes
  from ray.rllib.utils.framework import try_import_tf
label_desc: Use image node_id 2 for calling the VectorDecoder obj's underlying member method code with example usage: obj.call(h, z) and returns: loc