code: def test_different_per_node_beam_size(self):
      # per_node_beam_size = 1
      beam_search = BeamSearch(
          self.end_index, beam_size=3, per_node_beam_size=1
      )
      self._check_results(beam_search=beam_search)
  
      # per_node_beam_size = 2
      beam_search = BeamSearch(
          self.end_index, beam_size=3, per_node_beam_size=2
      )
      self._check_results(beam_search=beam_search)
  
imports: from typing import Dict, Tuple, Union
  import numpy
  import pytest
  import torch
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.nn.beam_search import MultinomialSampler, BeamSearch, TopKSampler, TopPSampler, GumbelSampler, LengthNormalizedSequenceLogProbabilityScorer, RepeatedNGramBlockingConstraint, StepFunctionTypeWithTimestep, StepFunctionTypeNoTimestep
  from allennlp.common.params import Params
  from allennlp.nn.util import min_value_of_dtype
label_desc: Use image node_id 12 for calling the BeamSearchTest obj's underlying member method code with example usage: obj.test_different_per_node_beam_size() without return types