class_docstr: Generic vision network.
class_docstr_tok: ["Generic","vision","network","."]
code: def value_function(self) -> TensorType:
      assert self._features is not None, "must call forward() first"
      if self._value_branch_separate:
          value = self._value_branch_separate(self._features)
          value = value.squeeze(3)
          value = value.squeeze(2)
          return value.squeeze(1)
      else:
          if not self.last_layer_is_flattened:
              features = self._features.squeeze(3)
              features = features.squeeze(2)
          else:
              features = self._features
          return self._value_branch(features).squeeze(1)
  
file_path: ray/python/ray/rllib/models/torch/visionnet.py
imports: import numpy
  from typing import Dict, List
  import gymnasium
  from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
  from ray.rllib.models.torch.misc import normc_initializer, same_padding, SlimConv2d, SlimFC
  from ray.rllib.models.utils import get_activation_fn, get_filter_config
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.typing import ModelConfigDict, TensorType
label_desc: Use image node_id 3 for calling the VisionNetwork obj's underlying member method code with example usage: obj.value_function() and returns: value, self