class_docstr: Randomly select a subsample of a range of indices.
  
  Internal use only. This should only be used by `plate`.
class_docstr_tok: ["Randomly","select","a","subsample","of","a","range","of","indices",".","Internal","use","only",".","This","should","only","be","used","by","`","plate","`","."]
docstr: :returns: a random subsample of `range(size)`
  :rtype: torch.LongTensor
docstr_tok: [":","returns",":","a","random","subsample","of","`","range","(","size",")","`",":","rtype",":","torch.LongTensor"]
code: def sample(
      self, sample_shape: torch.Size = torch.Size()
  ) -> torch.Tensor:
      """
      :returns: a random subsample of `range(size)`
      :rtype: torch.LongTensor
      """
      if sample_shape:
          raise NotImplementedError
      subsample_size = self.subsample_size
      if subsample_size is None or subsample_size >= self.size:
          result = torch.arange(self.size, device=self.device)
      else:
          result = torch.randperm(self.size, device=self.device)[
              :subsample_size
          ].clone()
      return result.cuda() if self.use_cuda else result
  
file_path: pyro/pyro/poutine/subsample_messenger.py
imports: from typing import Optional, Tuple
  import torch
  from pyro.distributions.distribution import Distribution
  from pyro.poutine.indep_messenger import CondIndepStackFrame, IndepMessenger
  from pyro.poutine.runtime import Message, apply_stack
  from pyro.poutine.util import is_validation_enabled
  from pyro.util import ignore_jit_warnings
label_desc: Use image node_id 2 for calling the _Subsample obj's underlying member method code with example usage: obj.sample(sample_shape) and returns: unknown