class_docstr: Autoregressive sequence model utilizing beam search.
  
  * batch_shape -> Given by initializer
  * event_shape -> N x T sequence of choices
  
  Parameters:
      model (AutoregressiveModel): A lazily computed autoregressive model.
      init (tuple of tensors, batch_shape x ...): initial state of autoregressive model.
      n_classes (int): number of classes in each time step
      n_length (int): max length of sequence
class_docstr_tok: ["Autoregressive","sequence","model","utilizing","beam","search",".","*","batch_shape","-",">","Given","by","initializer","*","event_shape","-",">","N","x","T","sequence","of","choices","Parameters",":","model","(","AutoregressiveModel",")",":","A","lazily","computed","autoregressive","model",".","init","(","tuple","of","tensors",",","batch_shape","x","...",")",":","initial","state","of","autoregressive","model",".","n_classes","(","int",")",":","number","of","classes","in","each","time","step","n_length","(","int",")",":","max","length","of","sequence"]
docstr: Compute sampling without replacement using Gumbel trick.
  
  Based on:
  
  * Stochastic Beams and Where to Find Them: The Gumbel-Top-k Trick for
         Sampling Sequences Without Replacement :cite:`DBLP:journals/corr/abs-1903-06059`
  
  Parameters:
      sample_shape (torch.Size): batch_size
  
  Returns:
      paths (*K x batch x N x C*)
docstr_tok: ["Compute","sampling","without","replacement","using","Gumbel","trick",".","Based","on",":","*","Stochastic","Beams","and","Where","to","Find","Them",":","The","Gumbel-Top-k","Trick","for","Sampling","Sequences","Without","Replacement",":","cite",":","`","DBLP",":","journals\/corr\/abs-1903-06059","`","Parameters",":","sample_shape","(","torch.Size",")",":","batch_size","Returns",":","paths","(","*","K","x","batch","x","N","x","C","*",")"]
code: def sample_without_replacement(self, sample_shape=torch.Size()):
      """
      Compute sampling without replacement using Gumbel trick.
  
      Based on:
  
      * Stochastic Beams and Where to Find Them: The Gumbel-Top-k Trick for
             Sampling Sequences Without Replacement :cite:`DBLP:journals/corr/abs-1903-06059`
  
      Parameters:
          sample_shape (torch.Size): batch_size
  
      Returns:
          paths (*K x batch x N x C*)
  
      """
      K = sample_shape[0]
      return self._beam_search(KMaxSemiring(K), gumbel=True)[0]
  
file_path: pytorch-struct/torch_struct/autoregressive.py
imports: import torch
  from .semirings import MaxSemiring, KMaxSemiring, TempMax
  from torch.distributions.distribution import Distribution
label_desc: Use image node_id 8 for calling the Autoregressive obj's underlying member method code with example usage: obj.sample_without_replacement(sample_shape) and returns: self