class_docstr: This class specifies the interface for a torch-based model.
  
  These methods should be implemented to have access to all of the features
  of Ax.
docstr: Generate new candidates.
  
  Args:
      n: Number of candidates to generate.
      search_space_digest: A SearchSpaceDigest object containing metadata
          about the search space (e.g. bounds, parameter types).
      torch_opt_config: A TorchOptConfig object containing optimization
          arguments (e.g., objective weights, constraints).
  
  Returns:
      A TorchGenResult container.
docstr_tok: ["Generate","new","candidates",".","Args",":","n",":","Number","of","candidates","to","generate",".","search_space_digest",":","A","SearchSpaceDigest","object","containing","metadata","about","the","search","space","(","e.g",".","bounds",",","parameter","types",")",".","torch_opt_config",":","A","TorchOptConfig","object","containing","optimization","arguments","(","e.g.",",","objective","weights",",","constraints",")",".","Returns",":","A","TorchGenResult","container","."]
code: def gen(
      self,
      n: int,
      search_space_digest: SearchSpaceDigest,
      torch_opt_config: TorchOptConfig,
  ) -> TorchGenResults:
      """
      Generate new candidates.
  
      Args:
          n: Number of candidates to generate.
          search_space_digest: A SearchSpaceDigest object containing metadata
              about the search space (e.g. bounds, parameter types).
          torch_opt_config: A TorchOptConfig object containing optimization
              arguments (e.g., objective weights, constraints).
  
      Returns:
          A TorchGenResult container.
      """
      raise NotImplementedError
  
imports: from __future__ import annotations
  from dataclasses import dataclass, field
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import torch
  from ax.core.metric import Metric
  from ax.core.search_space import SearchSpaceDigest
  from ax.core.types import TCandidateMetadata
  from ax.models.base import Model
  from ax.models.types import TConfig
  from botorch.acquisition.risk_measures import RiskMeasureMCObjective
  from botorch.utils.datasets import SupervisedDataset
  from torch import Tensor
label_desc: Use image node_id 3 for calling the TorchModel obj's underlying member method code with example usage: obj.gen(n, search_space_digest, torch_opt_config) without return types