class_docstr: A model bridge for using torch-based models.
  
  Specifies an interface that is implemented by TorchModel. In particular,
  model should have methods fit, predict, and gen. See TorchModel for the
  API for each of these methods.
  
  Requires that all parameters have been transformed to RangeParameters
  or FixedParameters with float type and no log scale.
  
  This class converts Ax parameter types to torch tensors before passing
  them to the model.
class_docstr_tok: ["A","model","bridge","for","using","torch-based","models",".","Specifies","an","interface","that","is","implemented","by","TorchModel",".","In","particular",",","model","should","have","methods","fit",",","predict",",","and","gen.","See","TorchModel","for","the","API","for","each","of","these","methods",".","Requires","that","all","parameters","have","been","transformed","to","RangeParameters","or","FixedParameters","with","float","type","and","no","log","scale",".","This","class","converts","Ax","parameter","types","to","torch","tensors","before","passing","them","to","the","model","."]
docstr: Apply terminal transform to given observation features and return result
  as an N x D array of points.
docstr_tok: ["Apply","terminal","transform","to","given","observation","features","and","return","result","as","an","N","x","D","array","of","points","."]
code: def _transform_observation_features(
      self, observation_features: List[ObservationFeatures]
  ) -> Tensor:
      """Apply terminal transform to given observation features and return result
      as an N x D array of points.
      """
      try:
          tobfs = np.array(
              [
                  # pyre-ignore[6]: Except statement below should catch wrongly
                  # typed parameters.
                  [float(of.parameters[p]) for p in self.parameters]
                  for of in observation_features
              ]
          )
      except (KeyError, TypeError):
          raise ValueError(
              "Invalid formatting of observation features."
          )
      return self._array_to_tensor(tobfs)
  
imports: from __future__ import annotations
  from collections import defaultdict
  from copy import deepcopy
  from logging import Logger
  from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
  import numpy
  import torch
  from ax.core.arm import Arm
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.generator_run import extract_arm_predictions
  from ax.core.metric import Metric
  from ax.core.observation import Observation, ObservationData, ObservationFeatures, separate_observations
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig, OptimizationConfig
  from ax.core.outcome_constraint import ComparisonOp, ObjectiveThreshold, ScalarizedOutcomeConstraint
  from ax.core.search_space import SearchSpace
  from ax.core.types import TCandidateMetadata, TModelPredictArm
  from ax.exceptions.core import DataRequiredError, UnsupportedError
  from ax.modelbridge.base import gen_arms, GenResults, ModelBridge
  from ax.modelbridge.modelbridge_utils import array_to_observation_data, extract_objective_thresholds, extract_objective_weights, extract_outcome_constraints, extract_parameter_constraints, extract_risk_measure, extract_search_space_digest, get_fixed_features, observation_data_to_array, observation_features_to_array, parse_observation_features, pending_observations_as_array_list, process_contextual_datasets, SearchSpaceDigest, transform_callback, validate_and_apply_final_transform
  from ax.modelbridge.transforms.base import Transform
  from ax.modelbridge.transforms.cast import Cast
  from ax.models.torch.botorch_modular.model import BoTorchModel
  from ax.models.torch.botorch_moo import MultiObjectiveBotorchModel
  from ax.models.torch.botorch_moo_defaults import infer_objective_thresholds
  from ax.models.torch_base import TorchModel, TorchOptConfig
  from ax.models.types import TConfig
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import not_none
  from botorch.utils.datasets import MultiTaskDataset, SupervisedDataset
  from torch import Tensor
label_desc: Use image node_id 17 for calling the TorchModelBridge obj's underlying member method code with example usage: obj._transform_observation_features(observation_features) and returns: self