class_docstr: Create a geometric distribution object.
  
  Parameters
  ----------
  prob : Tensor or scalar, default None
      Probability of sampling `1`.
  logit : Tensor or scalar, default None
      The log-odds of sampling `1`.
class_docstr_tok: ["Create","a","geometric","distribution","object",".","Parameters","--","--","--","--","--","prob",":","Tensor","or","scalar",",","default","None","Probability","of","sampling","`","1","`",".","logit",":","Tensor","or","scalar",",","default","None","The","log-odds","of","sampling","`","1","`","."]
code: def sample(self, size=None):
      if isinstance(self.prob, Number):
          shape_tensor = np.zeros(())
      else:
          shape_tensor = np.zeros_like(
              self.prob
          )  # pylint: disable=too-many-function-args
      u = np.random.uniform(shape_tensor, size=size)
      samples = np.floor(np.log(u) / np.log1p(-self.prob))
      return samples
  
file_path: mxnet/python/mxnet/gluon/probability/distributions/geometric.py
imports: from numbers import Number
  from .distribution import Distribution
  from .utils import prob2logit, logit2prob, cached_property, sample_n_shape_converter
  from .constraint import NonNegativeInteger, Interval, Real
  from ....None import np
label_desc: Use image node_id 8 for calling the Geometric obj's underlying member method code with example usage: obj.sample(size) and returns: samples