class_docstr: Generator for Thompson sampling.
  
  The generator performs Thompson sampling on the data passed in via `fit`.
  Arms are given weight proportional to the probability that they are
  winners, according to Monte Carlo simulations.
class_docstr_tok: ["Generator","for","Thompson","sampling",".","The","generator","performs","Thompson","sampling","on","the","data","passed","in","via","`","fit","`",".","Arms","are","given","weight","proportional","to","the","probability","that","they","are","winners",",","according","to","Monte","Carlo","simulations","."]
code: def _generate_samples_per_metric(
      self, num_samples: int
  ) -> np.ndarray:
      k = len(self.X)
      samples_per_metric = np.zeros(
          (k, num_samples, len(self.Ys))
      )  # k x num_samples x m
      for i, Y in enumerate(self.Ys):  # (k x 1)
          Yvar = self.Yvars[i]  # (k x 1)
          cov = np.diag(Yvar)  # (k x k)
          samples = np.random.multivariate_normal(
              Y, cov, num_samples
          ).T  # (k x num_samples)
          samples_per_metric[:, :, i] = samples
      return samples_per_metric
  
imports: import hashlib
  import json
  from typing import Dict, List, Optional, Tuple
  import numpy
  from ax.core.types import TGenMetadata, TParamValue, TParamValueList
  from ax.exceptions.constants import TS_MIN_WEIGHT_ERROR, TS_NO_FEASIBLE_ARMS_ERROR
  from ax.exceptions.model import ModelError
  from ax.models.discrete_base import DiscreteModel
  from ax.models.types import TConfig
  from ax.utils.common.docutils import copy_doc
label_desc: Use image node_id 6 for calling the ThompsonSampler obj's underlying member method code with example usage: obj._generate_samples_per_metric(num_samples) and returns: samples_per_metric