docstr: Test that DCE doesn't remove torch._assert since it has side effects.
docstr_tok: ["Test","that","DCE","does","n't","remove","torch._assert","since","it","has","side","effects","."]
code: def test_keep_torch_assert(self):
      """
      Test that DCE doesn't remove torch._assert since it has side effects.
      """
  
      class TestModule(torch.nn.Module):
          def forward(self, a: torch.Tensor) -> torch.Tensor:
              torch._assert(torch.equal(a, a), "a must equal a")
              return a * 2
  
      # Note: Don't need to specify torch._assert as having side effects
      # because it's known to.
      self._run_dce_and_test(TestModule(), expect_dce_changes=False)
  
file_path: pytorch/test/fx/test_dce_pass.py
imports: from typing import Set, Type
  import torch
  import torch.fx
  from torch.testing._internal.common_utils import TestCase
label_desc: Use image node_id 10 for calling the TestDCE obj's underlying member method code with example usage: obj.test_keep_torch_assert() and returns: unknown