docstr: Initialize constraint states for constrained decoding (if supported).
  
  Args:
      batch_constraints: (torch.Tensor, optional)
          the list of constraints, in packed form
      beam_size: (int)
          the beam size
  Returns:
      *encoder_out* rearranged according to *new_order*
docstr_tok: ["Initialize","constraint","states","for","constrained","decoding","(","if","supported",")",".","Args",":","batch_constraints",":","(","torch.Tensor",",","optional",")","the","list","of","constraints",",","in","packed","form","beam_size",":","(","int",")","the","beam","size","Returns",":","*","encoder_out","*","rearranged","according","to","*","new_order","*"]
code: def init_constraints(
      self, batch_constraints: Optional[Tensor], beam_size: int
  ):
      """Initialize constraint states for constrained decoding (if supported).
  
      Args:
          batch_constraints: (torch.Tensor, optional)
              the list of constraints, in packed form
          beam_size: (int)
              the beam size
      Returns:
          *encoder_out* rearranged according to *new_order*
      """
      pass
  
imports: from typing import Dict, Optional
  import torch
  import torch.nn
  from torch import Tensor
label_desc: Use image node_id 4 for calling the MultichannelSearch obj's underlying member method code with example usage: obj.init_constraints(batch_constraints, beam_size) without return types