code: def test_forward_attn_hidden_size(pretrain_file):
      """
      Test that when attn is used with hidden sizes not evenly divisible by reduce_heads, the model reconfigures the hidden_size
      """
      model = build_model(
          pretrain_file,
          "--constituency_composition",
          "attn",
          "--hidden_size",
          "129",
      )
      assert model.hidden_size >= 129
      assert model.hidden_size % model.reduce_heads == 0
      run_forward_checks(model, num_states=2)
  
      model = build_model(
          pretrain_file,
          "--constituency_composition",
          "attn",
          "--hidden_size",
          "129",
          "--reduce_heads",
          "10",
      )
      assert model.hidden_size == 130
      assert model.reduce_heads == 10
  
imports: import os
  import pytest
  import torch
  from stanza.models.common import pretrain
  from stanza.models.common.utils import set_random_seed
  from stanza.models.constituency import parse_transitions
  from stanza.tests import *
  from stanza.tests.constituency import test_parse_transitions
  from stanza.tests.constituency.test_trainer import build_trainer
label_desc: Use image node_id 26 for calling a global function with example usage: test_forward_attn_hidden_size(pretrain_file) without return types