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"]
code: def __init__(
      self,
      model,
      initial_state,
      n_classes,
      n_length,
      normalize=True,
      start_class=0,
      end_class=None,
  ):
      self.model = model
      self.init = initial_state
      self.n_length = n_length
      self.n_classes = n_classes
      self.start_class = start_class
      self.normalize = normalize
      event_shape = (n_length, n_classes)
      batch_shape = initial_state[0].shape[:1]
      self.device = initial_state[0].device
      super().__init__(batch_shape=batch_shape, event_shape=event_shape)
  
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 1 to create a new Autoregressive object from inherited base classes: Distribution with example: obj = Autoregressive(model, initial_state, n_classes, n_length, normalize, start_class, end_class)