docstr: Tests that a chain of two nodes in the graph are DCE'd correctly.
docstr_tok: ["Tests","that","a","chain","of","two","nodes","in","the","graph","are","DCE","'d","correctly","."]
code: def test_dead_chain(self):
      """
      Tests that a chain of two nodes in the graph are DCE'd correctly.
      """
  
      class TestModule(torch.nn.Module):
          def __init__(self):
              super().__init__()
              self.attr_1 = torch.nn.Parameter(torch.tensor([-0.9]))
  
          def forward(self, x):
              a = x + 1
              b = a * 7
              return x + self.attr_1
  
      self._run_dce_and_test(TestModule(), expect_dce_changes=True)
  
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 5 for calling the TestDCE obj's underlying member method code with example usage: obj.test_dead_chain() and returns: unknown