code: def test_two_tag_training_backprop(pretrain_file, tmp_path):
      """
      Test that the training is backproping both tags
  
      We can do this by using the "finetune" mechanism and verifying
      that the output tensors are different
      """
      trainer = run_two_tag_training(pretrain_file, tmp_path)
  
      # first, need to save the final model before restarting
      # (alternatively, could reload the final checkpoint)
      trainer.save(
          os.path.join(
              trainer.args["save_dir"], trainer.args["save_name"]
          )
      )
      new_trainer = run_two_tag_training(
          pretrain_file, tmp_path, "--finetune"
      )
  
      assert len(trainer.model.tag_clfs) == 2
      assert len(new_trainer.model.tag_clfs) == 2
      for old_clf, new_clf in zip(
          trainer.model.tag_clfs, new_trainer.model.tag_clfs
      ):
          assert not torch.allclose(old_clf.weight, new_clf.weight)
  
imports: import json
  import logging
  import os
  import warnings
  import pytest
  import torch
  from stanza.models import ner_tagger
  from stanza.models.ner.trainer import Trainer
  from stanza.tests import TEST_WORKING_DIR
  from stanza.utils.datasets.ner.prepare_ner_file import process_dataset
label_desc: Use image node_id 7 for calling a global function with example usage: test_two_tag_training_backprop(pretrain_file, tmp_path) without return types