class_docstr: Weibull distribution.
  
  We use the parametrization of the Weibull distribution using the rate
  parameter :math:`b > 0` and the shape parameter :math:`k > 0`. The PDF is
  :math:`p(x) = b * k * x^{(k - 1)} * \exp(-b * x^k)`. An alternative
  parametrization is often used (e.g. on Wikipedia), where we use the scale
  parameter :math:`\lambda > 0` and the shape parameter :math:`k > 0`, and
  :math:`\lambda = b^{-1/k}`.
docstr: Draw samples from the distribution.
  
  We generate samples as :math:`u \sim Uniform(0, 1), x = S^{-1}(u)`,
  where :math:`S^{-1}` is the inverse of the survival function
  :math:`S(x) = 1 - CDF(x)`.
  
  Parameters
  ----------
  num_samples
      Number of samples to generate.
  dtype
      Data type of the generated samples.
  lower_bound
      If None, generate samples as usual. If lower_bound is provided,
      all generated samples will be larger than the specified values.
      That is, we sample from `p(x | x > lower_bound)`.
      Shape: `(*batch_size)`
  
  Returns
  -------
  x
      Sampled inter-event times.
      Shape: `(num_samples, *batch_size)`
docstr_tok: ["Draw","samples","from","the","distribution",".","We","generate","samples","as",":","math",":","`","u","\\sim","Uniform","(","0",",","1",")",",","x","=","S^","{","-1","}","(","u",")","`",",","where",":","math",":","`","S^","{","-1","}","`","is","the","inverse","of","the","survival","function",":","math",":","`","S","(","x",")","=","1","-","CDF","(","x",")","`",".","Parameters","--","--","--","--","--","num_samples","Number","of","samples","to","generate",".","dtype","Data","type","of","the","generated","samples",".","lower_bound","If","None",",","generate","samples","as","usual",".","If","lower_bound","is","provided",",","all","generated","samples","will","be","larger","than","the","specified","values",".","That","is",",","we","sample","from","`","p","(","x","|","x",">","lower_bound",")","`",".","Shape",":","`","(","*","batch_size",")","`","Returns","--","--","--","-","x","Sampled","inter-event","times",".","Shape",":","`","(","num_samples",",","*","batch_size",")","`"]
code: def sample(
      self,
      num_samples=None,
      dtype=np.float32,
      lower_bound: Optional[Tensor] = None,
  ) -> Tensor:
      r"""
      Draw samples from the distribution.
  
      We generate samples as :math:`u \sim Uniform(0, 1), x = S^{-1}(u)`,
      where :math:`S^{-1}` is the inverse of the survival function
      :math:`S(x) = 1 - CDF(x)`.
  
      Parameters
      ----------
      num_samples
          Number of samples to generate.
      dtype
          Data type of the generated samples.
      lower_bound
          If None, generate samples as usual. If lower_bound is provided,
          all generated samples will be larger than the specified values.
          That is, we sample from `p(x | x > lower_bound)`.
          Shape: `(*batch_size)`
  
      Returns
      -------
      x
          Sampled inter-event times.
          Shape: `(num_samples, *batch_size)`
      """
      F = getF(self.rate)
      if num_samples is not None:
          sample_shape = (num_samples,) + self.batch_shape
      else:
          sample_shape = self.batch_shape
      u = F.uniform(0, 1, shape=sample_shape)
      # Make sure that the generated samples are larger than condition_above.
      # This is easy to ensure when using inverse-survival sampling: we
      # simply multiply `u ~ Uniform(0, 1)` by `S(y)` to ensure that `x > y`.
      with autograd.pause():
          if lower_bound is not None:
              survival = self.log_survival(lower_bound).exp()
              u = u * survival
          x = (-u.log() / self.rate) ** (1.0 / self.shape)
      return x
  
imports: from typing import Dict, Optional, Tuple
  import numpy
  from mxnet import autograd, nd
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from gluonts.mx.distribution.distribution import getF
  from .base import TPPDistribution, TPPDistributionOutput
label_desc: Use image node_id 9 for calling the Weibull obj's underlying member method code with example usage: obj.sample(num_samples, dtype, lower_bound) and returns: x