code: def test_check_export_model_diff_returns_diff_when_constant_mismatch(
      self,
  ):
      class UnexportableModel(torch.nn.Module):
          def forward(self, x, y):
              # tensor.data() will be exported as a constant,
              # leading to wrong model output under different inputs.
              return x + y.data
  
      test_input_groups = [
          ((torch.randn(2, 3), torch.randn(2, 3)), {}),
          ((torch.randn(2, 3), torch.randn(2, 3)), {}),
      ]
  
      results = verification.check_export_model_diff(
          UnexportableModel(), test_input_groups
      )
      self.assertRegex(
          results,
          r"Graph diff:(.|\n)*"
          r"First diverging operator:(.|\n)*"
          r"prim::Constant(.|\n)*"
          r"Former source location:(.|\n)*"
          r"Latter source location:",
      )
  
imports: import contextlib
  import io
  import tempfile
  import unittest
  import numpy
  import onnx
  import parameterized
  import pytorch_test_common
  import torch
  from packaging import version
  from torch.onnx import _constants, _experimental, verification
  from torch.testing._internal import common_utils
label_desc: Use image node_id 1 for calling the TestVerification obj's underlying member method code with example usage: obj.test_check_export_model_diff_returns_diff_when_constant_mismatch() and returns: unknown