code: def test_forward_constituency_composition(pretrain_file):
      """
      Test different constituency composition functions
      """
      model = build_model(
          pretrain_file, "--constituency_composition", "bilstm"
      )
      run_forward_checks(model, num_states=2)
  
      model = build_model(
          pretrain_file, "--constituency_composition", "max"
      )
      run_forward_checks(model, num_states=2)
  
      model = build_model(
          pretrain_file, "--constituency_composition", "key"
      )
      run_forward_checks(model, num_states=2)
  
      model = build_model(
          pretrain_file, "--constituency_composition", "untied_key"
      )
      run_forward_checks(model, num_states=2)
  
      model = build_model(
          pretrain_file, "--constituency_composition", "untied_max"
      )
      run_forward_checks(model, num_states=2)
  
      model = build_model(
          pretrain_file, "--constituency_composition", "bilstm_max"
      )
      run_forward_checks(model, num_states=2)
  
      model = build_model(
          pretrain_file, "--constituency_composition", "tree_lstm"
      )
      run_forward_checks(model, num_states=2)
  
      model = build_model(
          pretrain_file, "--constituency_composition", "tree_lstm_cx"
      )
      run_forward_checks(model, num_states=2)
  
      model = build_model(
          pretrain_file, "--constituency_composition", "bigram"
      )
      run_forward_checks(model, num_states=2)
  
      model = build_model(
          pretrain_file, "--constituency_composition", "attn"
      )
      run_forward_checks(model, num_states=2)
  
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 24 for calling a global function with example usage: test_forward_constituency_composition(pretrain_file) without return types