class_docstr: Generic vision network implemented in ModelV2 API.
  
  An additional post-conv fully connected stack can be added and configured
  via the config keys:
  `post_fcnet_hiddens`: Dense layer sizes after the Conv2D stack.
  `post_fcnet_activation`: Activation function to use for this FC stack.
class_docstr_tok: ["Generic","vision","network","implemented","in","ModelV2","API",".","An","additional","post-conv","fully","connected","stack","can","be","added","and","configured","via","the","config","keys",":","`","post_fcnet_hiddens","`",":","Dense","layer","sizes","after","the","Conv2D","stack",".","`","post_fcnet_activation","`",":","Activation","function","to","use","for","this","FC","stack","."]
code: def forward(
      self,
      input_dict: Dict[str, TensorType],
      state: List[TensorType],
      seq_lens: TensorType,
  ) -> (TensorType, List[TensorType]):
      obs = input_dict["obs"]
      if self.data_format == "channels_first":
          obs = tf.transpose(obs, [0, 2, 3, 1])
      # Explicit cast to float32 needed in eager.
      model_out, self._value_out = self.base_model(
          tf.cast(obs, tf.float32)
      )
      # Our last layer is already flat.
      if self.last_layer_is_flattened:
          return model_out, state
      # Last layer is a n x [1,1] Conv2D -> Flatten.
      else:
          return tf.squeeze(model_out, axis=[1, 2]), state
  
file_path: ray/rllib/models/tf/visionnet.py
imports: import gymnasium
  from typing import Dict, List
  from ray.rllib.utils.annotations import DeveloperAPI
  from ray.rllib.models.tf.tf_modelv2 import TFModelV2
  from ray.rllib.models.tf.misc import normc_initializer
  from ray.rllib.models.utils import get_activation_fn, get_filter_config
  from ray.rllib.utils.framework import try_import_tf
  from ray.rllib.utils.typing import ModelConfigDict, TensorType
label_desc: Use image node_id 2 for calling the VisionNetwork obj's underlying member method code with example usage: obj.forward(input_dict, state, seq_lens) and returns: model_out,  state, tf,  state