class_docstr: Abstract base class for sampling-based generation strategies.
  
  :meta private:
docstr: Sample according to the SamplingStrategy.
  
  Args:
      X: A `batch_shape x N x d`-dim Tensor from which to sample (in the `N`
          dimension).
      num_samples: The number of samples to draw.
      kwargs: Additional implementation-specific kwargs.
  
  Returns:
      A `batch_shape x num_samples x d`-dim Tensor of samples from `X`, where
      `X[..., i, :]` is the `i`-th sample.
docstr_tok: ["Sample","according","to","the","SamplingStrategy",".","Args",":","X",":","A","`","batch_shape","x","N","x","d","`","-dim","Tensor","from","which","to","sample","(","in","the","`","N","`","dimension",")",".","num_samples",":","The","number","of","samples","to","draw",".","kwargs",":","Additional","implementation-specific","kwargs",".","Returns",":","A","`","batch_shape","x","num_samples","x","d","`","-dim","Tensor","of","samples","from","`","X","`",",","where","`","X","[","...",",","i",",",":","]","`","is","the","`","i","`","-th","sample","."]
code: def forward(
      self, X: Tensor, num_samples: int = 1, **kwargs: Any
  ) -> Tensor:
      r"""Sample according to the SamplingStrategy.
  
      Args:
          X: A `batch_shape x N x d`-dim Tensor from which to sample (in the `N`
              dimension).
          num_samples: The number of samples to draw.
          kwargs: Additional implementation-specific kwargs.
  
      Returns:
          A `batch_shape x num_samples x d`-dim Tensor of samples from `X`, where
          `X[..., i, :]` is the `i`-th sample.
      """
  
      pass
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from typing import Any, Optional, Union
  import torch
  from botorch.acquisition.acquisition import AcquisitionFunction
  from botorch.acquisition.objective import IdentityMCObjective, MCAcquisitionObjective, PosteriorTransform
  from botorch.generation.utils import _flip_sub_unique
  from botorch.models.model import Model
  from botorch.models.model_list_gp_regression import ModelListGP
  from botorch.models.multitask import MultiTaskGP
  from botorch.utils.sampling import batched_multinomial
  from botorch.utils.transforms import standardize
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 1 for calling the SamplingStrategy obj's underlying member method code with example usage: obj.forward(X, num_samples) without return types