docstr: Return True if all bert weights are close, False otherwise
docstr_tok: ["Return","True","if","all","bert","weights","are","close",",","False","otherwise"]
code: def bert_weights_allclose(self, bert_model, parser_model):
      """
      Return True if all bert weights are close, False otherwise
      """
      for name, parameter in bert_model.named_parameters():
          other_name = "bert_model." + name
          other_parameter = parser_model.model.get_parameter(other_name)
          if not torch.allclose(parameter.cpu(), other_parameter.cpu()):
              return False
      return True
  
imports: from collections import defaultdict
  import logging
  import pathlib
  import tempfile
  import pytest
  import torch
  from torch import optim
  from stanza import Pipeline
  from stanza.models import constituency_parser
  from stanza.models.common import pretrain
  from stanza.models.common.bert_embedding import load_bert, load_tokenizer
  from stanza.models.common.foundation_cache import FoundationCache
  from stanza.models.common.utils import set_random_seed
  from stanza.models.constituency import lstm_model
  from stanza.models.constituency import trainer
  from stanza.models.constituency import tree_reader
  from stanza.tests import *
label_desc: Use image node_id 19 for calling the TestTrainer obj's underlying member method code with example usage: obj.bert_weights_allclose(bert_model, parser_model) and returns: True, False