code: def test_do_not_skip_side_effects(self):
      # https://github.com/pytorch/pytorch/issues/110765
  
      # By invoking torch._utils.is_compiling(),
      # there may be side-effects inconsistent with eager when
      # compiling. Thus we force dynamo to commit the graph,
      # even if it does not perform any tensor operation
      global _variable, _variable_2
  
      for mode in range(1, 7):
          _variable = 0
          _variable_2 = 0
  
          mod = MyModule(mode=mode)
          model = torch._dynamo.optimize(
              backend="eager", nopython=mode != 6
          )(mod)
          assert _variable == 0
          assert _variable_2 == 0
  
          model(torch.tensor([1]))
          assert _variable == 1
          assert _variable_2 == 0
  
          model(torch.tensor([1]))
          assert _variable == 2
          assert _variable_2 == 0
  
imports: from unittest.mock import patch
  import torch
  import torch._dynamo
  import torch._dynamo.test_case
  from torch._dynamo.testing import CompileCounter
label_desc: Use image node_id 8 for calling the SkipNonTensorTests obj's underlying member method code with example usage: obj.test_do_not_skip_side_effects() without return types