class_docstr: A sampler for sampling from a polyope using a hit-and-run algorithm.
class_docstr_tok: ["A","sampler","for","sampling","from","a","polyope","using","a","hit-and-run","algorithm","."]
docstr: Draw samples from the polytope.
  
  Args:
      n: The number of samples.
      seed: The random seed.
  
  Returns:
      A `n x d` Tensor of samples from the polytope.
docstr_tok: ["Draw","samples","from","the","polytope",".","Args",":","n",":","The","number","of","samples",".","seed",":","The","random","seed",".","Returns",":","A","`","n","x","d","`","Tensor","of","samples","from","the","polytope","."]
code: def draw(self, n: int = 1, seed: Optional[int] = None) -> Tensor:
      r"""Draw samples from the polytope.
  
      Args:
          n: The number of samples.
          seed: The random seed.
  
      Returns:
          A `n x d` Tensor of samples from the polytope.
      """
      transformed_samples = sample_polytope(
          # run this on the cpu
          A=self.new_A.cpu(),
          b=(self.b - self.A @ self.x0).cpu(),
          x0=torch.zeros((self.nullC.size(1), 1), dtype=self.A.dtype),
          n=n,
          n0=self.n_burnin,
          seed=seed,
      ).to(self.b)
      init_shift = self.x0.transpose(-1, -2)
      samples = init_shift + transformed_samples @ self.nullC.transpose(
          -1, -2
      )
      # keep the last element of the resulting chain as
      # the beginning of the next chain
      self.x0 = samples[-1].reshape(-1, 1)
      # reset counter so there is no burn-in for subsequent samples
      self.n_burnin = 0
      return samples
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from contextlib import contextmanager
  from typing import Any, Generator, Iterable, List, Optional, Tuple, TYPE_CHECKING
  import numpy
  import scipy
  import torch
  from botorch.exceptions.errors import BotorchError
  from botorch.sampling.qmc import NormalQMCEngine
  from botorch.utils.transforms import unnormalize
  from scipy.spatial import Delaunay, HalfspaceIntersection
  from torch import LongTensor, Tensor
  from torch.quasirandom import SobolEngine
label_desc: Use image node_id 2 for calling the HitAndRunPolytopeSampler obj's underlying member method code with example usage: obj.draw(n, seed) and returns: samples