code: def assertTensorEqual(self, t1, t2):
      t1 = t1[
          ~torch.isnan(t1)
      ]  # can cause size mismatch errors if there are NaNs
      t2 = t2[~torch.isnan(t2)]
      self.assertEqual(t1.size(), t2.size(), "size mismatch")
      self.assertEqual(t1.ne(t2).long().sum(), 0)
  
file_path: fairseq/tests/test_lstm_jitable.py
imports: import argparse
  import tempfile
  import unittest
  import torch
  from fairseq.data.dictionary import Dictionary
  from fairseq.models.lstm import LSTMModel
  from fairseq.tasks.fairseq_task import LegacyFairseqTask
label_desc: Use image node_id 2 for calling the TestJitLSTMModel obj's underlying member method code with example usage: obj.assertTensorEqual(t1, t2) without return types