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: An updated version of `TorchModelBridge._gen(...) that first injects
  `map_dim_to_target` (e.g., `{-1: 1.0}`) into `model_gen_options` so that
  the target values of the map_keys are known during candidate generation.
docstr_tok: ["An","updated","version","of","`","TorchModelBridge._gen","(","...",")","that","first","injects","`","map_dim_to_target","`","(","e.g.",",","`","{","-1",":","1.0","}","`",")","into","`","model_gen_options","`","so","that","the","target","values","of","the","map_keys","are","known","during","candidate","generation","."]
code: def _gen(
      self,
      n: int,
      search_space: SearchSpace,
      pending_observations: Dict[str, List[ObservationFeatures]],
      fixed_features: Optional[ObservationFeatures],
      model_gen_options: Optional[TConfig] = None,
      optimization_config: Optional[OptimizationConfig] = None,
  ) -> GenResults:
      """An updated version of `TorchModelBridge._gen(...) that first injects
      `map_dim_to_target` (e.g., `{-1: 1.0}`) into `model_gen_options` so that
      the target values of the map_keys are known during candidate generation.
      """
      model_gen_options = self._add_map_dim_to_target(
          options=model_gen_options or {}
      )
      return super()._gen(
          n=n,
          search_space=search_space,
          pending_observations=pending_observations,
          fixed_features=fixed_features,
          model_gen_options=model_gen_options,
          optimization_config=optimization_config,
      )
  
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 5 for calling the MapTorchModelBridge obj's underlying member method code with example usage: obj._gen(n, search_space, pending_observations, fixed_features, model_gen_options, optimization_config) and returns: super