class_docstr: A model bridge for using torch-based models that fit on MapData. Most
  of the `TorchModelBridge` functionality is retained, except that this
  class should be used in the case where `model` makes use of map_key values.
  For example, the use case of fitting a joint surrogate model on
  `(parameters, map_key)`, while candidate generation is only for `parameters`.
class_docstr_tok: ["A","model","bridge","for","using","torch-based","models","that","fit","on","MapData",".","Most","of","the","`","TorchModelBridge","`","functionality","is","retained",",","except","that","this","class","should","be","used","in","the","case","where","`","model","`","makes","use","of","map_key","values",".","For","example",",","the","use","case","of","fitting","a","joint","surrogate","model","on","`","(","parameters",",","map_key",")","`",",","while","candidate","generation","is","only","for","`","parameters","`","."]
docstr: Uses `map_key_ranges` to detect which `observation_features` have
  out-of-range map_keys and filters out the corresponding outcomes in
  `observation_data`.
docstr_tok: ["Uses","`","map_key_ranges","`","to","detect","which","`","observation_features","`","have","out-of-range","map_keys","and","filters","out","the","corresponding","outcomes","in","`","observation_data","`","."]
code: def _filter_outcomes_out_of_map_range(
      self,
      observation_features: List[ObservationFeatures],
      observation_data: List[ObservationData],
      # pyre-fixme[24]: Generic type `tuple` expects at least 1 type parameter.
      map_key_ranges: Dict[str, Dict[str, Optional[Tuple]]],
  ) -> List[ObservationData]:
      """Uses `map_key_ranges` to detect which `observation_features` have
      out-of-range map_keys and filters out the corresponding outcomes in
      `observation_data`.
      """
      filtered_observation_data = []
      for obsf, obsd in zip(observation_features, observation_data):
          metric_names = obsd.metric_names
          means = obsd.means
          covariance = obsd.covariance
          for o in self.outcomes:
              if o in metric_names:
                  for p in self._map_key_features:
                      map_key_value = obsf.parameters[p]
                      map_key_range = map_key_ranges[o][p]
                      if map_key_range is not None:
                          range_min, range_max = map_key_range
                          if (
                              map_key_value < range_min
                              or map_key_value > range_max
                          ):
                              p_idx = metric_names.index(o)
                              metric_names.pop(p_idx)
                              means = np.delete(means, p_idx, axis=0)
                              covariance = np.delete(
                                  covariance, p_idx, axis=0
                              )
                              covariance = np.delete(
                                  covariance, p_idx, axis=1
                              )
                              break
          new_obsd = ObservationData(
              metric_names=metric_names,
              means=means,
              covariance=covariance,
          )
          filtered_observation_data.append(new_obsd)
      return filtered_observation_data
  
imports: from typing import Any, Dict, List, Optional, Tuple, Type
  import numpy
  import torch
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.map_data import MapData
  from ax.core.observation import Observation, ObservationData, ObservationFeatures, observations_from_map_data, separate_observations
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.search_space import SearchSpace
  from ax.core.types import TCandidateMetadata
  from ax.modelbridge.base import GenResults
  from ax.modelbridge.modelbridge_utils import array_to_observation_data, observation_features_to_array, parse_observation_features
  from ax.modelbridge.torch import FIT_MODEL_ERROR, TorchModelBridge
  from ax.modelbridge.transforms.base import Transform
  from ax.models.torch_base import TorchModel
  from ax.models.types import TConfig
  from ax.utils.common.constants import Keys
  from ax.utils.common.typeutils import not_none
label_desc: Use image node_id 10 for calling the MapTorchModelBridge obj's underlying member method code with example usage: obj._filter_outcomes_out_of_map_range(observation_features, observation_data, map_key_ranges) and returns: filtered_observation_data