class_docstr: Decodes the output of Beam Search to get the top hypotheses
class_docstr_tok: ["Decodes","the","output","of","Beam","Search","to","get","the","top","hypotheses"]
code: def _check_dimensions(
      self,
      beam_tokens: Tensor,
      beam_scores: Tensor,
      token_weights: Tensor,
      beam_prev_indices: Tensor,
      num_steps: int,
  ) -> None:
      assert (
          beam_tokens.size(1) == self.beam_size
      ), "Dimension of beam_tokens : {} and beam size : {} are not consistent".format(
          beam_tokens.size(), self.beam_size
      )
      assert beam_scores.size(1) == self.beam_size, (
          "Dimension of beam_scores : {} and beam size : {} "
          "are not consistent".format(
              beam_scores.size(), self.beam_size
          )
      )
      assert token_weights.size(1) == self.beam_size, (
          "Dimension of token_weights : {} and beam size : {} "
          "are not consistent".format(
              token_weights.size(), self.beam_size
          )
      )
      assert (
          beam_prev_indices.size(1) == self.beam_size
      ), "Dimension of beam_prev_indices : {} and beam size : {} "
      "are not consistent".format(
          beam_prev_indices.size(), self.beam_size
      )
  
      assert beam_tokens.size(0) <= num_steps + 1, (
          "Dimension of beam_tokens : {} and num_steps : {} "
          "are not consistent".format(beam_tokens.size(), num_steps)
      )
      assert beam_scores.size(0) <= num_steps + 1, (
          "Dimension of beam_scores : {} and num_steps : {} "
          "are not consistent".format(beam_scores.size(), num_steps)
      )
      assert token_weights.size(0) <= num_steps + 1, (
          "Dimension of token_weights : {} and num_steps : {} "
          "are not consistent".format(token_weights.size(), num_steps)
      )
      assert beam_prev_indices.size(0) <= num_steps + 1, (
          "Dimension of beam_prev_indices : {} and num_steps : {} "
          "are not consistent".format(
              beam_prev_indices.size(), num_steps
          )
      )
  
file_path: pytext/pytext/torchscript/seq2seq/beam_decode.py
imports: from typing import List, Tuple
  import torch
  from torch import Tensor
label_desc: Use image node_id 6 for calling the BeamDecode obj's underlying member method code with example usage: obj._check_dimensions(beam_tokens, beam_scores, token_weights, beam_prev_indices, num_steps) without return types