code: def test_lattn_projection(pretrain_file):
      """
      Test with & without labeled attention layers
      """
      with pytest.raises(ValueError):
          # this is too small
          model = build_model(
              pretrain_file,
              "--pattn_d_model",
              "1024",
              "--lattn_d_proj",
              "64",
              "--lattn_d_l",
              "16",
              "--lattn_d_input_proj",
              "256",
              "--lattn_partitioned",
          )
          run_forward_checks(model)
  
      model = build_model(
          pretrain_file,
          "--pattn_d_model",
          "1024",
          "--lattn_d_proj",
          "64",
          "--lattn_d_l",
          "16",
          "--no_lattn_partitioned",
          "--lattn_d_input_proj",
          "256",
      )
      run_forward_checks(model)
  
      model = build_model(
          pretrain_file,
          "--lattn_d_proj",
          "64",
          "--lattn_d_l",
          "16",
          "--lattn_d_input_proj",
          "768",
      )
      run_forward_checks(model)
  
      # check that it works if we turn off the projection,
      # in case having it on beccomes the default
      model = build_model(
          pretrain_file,
          "--lattn_d_proj",
          "64",
          "--lattn_d_l",
          "16",
          "--lattn_d_input_proj",
          "0",
      )
      run_forward_checks(model)
  
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 30 for calling a global function with example usage: test_lattn_projection(pretrain_file) without return types