class_docstr: Test if serializer/deserializer behaves correctly if version mismatch.
class_docstr_tok: ["Test","if","serializer\/deserializer","behaves","correctly","if","version","mismatch","."]
code: def test_opset_mismatch_raises(self):
      compiler_opset_version = {"aten": 4}
      model_opset_version = {"aten": 3}
      deserializer = ExportedProgramDeserializer(compiler_opset_version)
      with self.assertRaises(NotImplementedError):
          deserializer._validate_model_opset_version(
              model_opset_version
          )
  
imports: import io
  import pathlib
  import tempfile
  import unittest
  import zipfile
  import torch
  import torch._dynamo
  from torch.export import export, save, load, Dim
  from torch._export.db.case import ExportCase, normalize_inputs, SupportLevel
  from torch._export.db.examples import all_examples
  from torch._export.serde.serialize import ExportedProgramDeserializer, ExportedProgramSerializer, canonicalize, deserialize, serialize, SerializeError
  from torch._subclasses.fake_tensor import FakeTensor
  from torch.fx.experimental.symbolic_shapes import is_concrete_int
  import torch.utils._pytree
  from torch.testing._internal.common_utils import instantiate_parametrized_tests, parametrize, run_tests, TestCase, TemporaryFileName, IS_FBCODE, IS_MACOS, IS_SANDCASTLE, IS_WINDOWS, find_library_location
label_desc: Use image node_id 2 for calling the TestOpVersioning obj's underlying member method code with example usage: obj.test_opset_mismatch_raises() without return types