class_docstr: Assigns the `_value()` method to a TorchPolicy.
  
  This way, Policy can call `_value()` to get the current VF estimate on a
  single(!) observation (as done in `postprocess_trajectory_fn`).
  Note: When doing this, an actual forward pass is being performed.
  This is different from only calling `model.value_function()`, where
  the result of the most recent forward pass is being used to return an
  already calculated tensor.
class_docstr_tok: ["Assigns","the","`","_value","(",")","`","method","to","a","TorchPolicy",".","This","way",",","Policy","can","call","`","_value","(",")","`","to","get","the","current","VF","estimate","on","a","single","(","!",")","observation","(","as","done","in","`","postprocess_trajectory_fn","`",")",".","Note",":","When","doing","this",",","an","actual","forward","pass","is","being","performed",".","This","is","different","from","only","calling","`","model.value_function","(",")","`",",","where","the","result","of","the","most","recent","forward","pass","is","being","used","to","return","an","already","calculated","tensor","."]
code: def __init__(self, config):
      # When doing GAE, we need the value function estimate on the
      # observation.
      if config.get("use_gae") or config.get("vtrace"):
          # Input dict is provided to us automatically via the Model's
          # requirements. It's a single-timestep (last one in trajectory)
          # input_dict.
  
          def value(**input_dict):
              input_dict = SampleBatch(input_dict)
              input_dict = self._lazy_tensor_dict(input_dict)
              model_out, _ = self.model(input_dict)
              # [0] = remove the batch dim.
              return self.model.value_function()[0].item()
  
      # When not doing GAE, we do not require the value function's output.
      else:
  
          def value(*args, **kwargs):
              return 0.0
  
      self._value = value
  
imports: from ray.rllib.policy.policy import Policy, PolicyState
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.torch_policy import TorchPolicy
  from ray.rllib.utils.annotations import DeveloperAPI, override
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.schedules import PiecewiseSchedule
label_desc: Use image node_id 1 to create a new ValueNetworkMixin object  with example: obj = ValueNetworkMixin(config)