docstr: The GraphModule passed to GraphLowering init method is like:
  https://gist.github.com/shunting314/fd60fe11d1f844c6db76aba7b06811bc
  
  It shows that the output of the graph is the mul node which contains
  the update we applied to the base tensor.
docstr_tok: ["The","GraphModule","passed","to","GraphLowering","init","method","is","like",":","https",":","\/\/gist.github.com\/shunting314\/fd60fe11d1f844c6db76aba7b06811bc","It","shows","that","the","output","of","the","graph","is","the","mul","node","which","contains","the","update","we","applied","to","the","base","tensor","."]
code: def test_mutate_base(self):
      """
      The GraphModule passed to GraphLowering init method is like:
      https://gist.github.com/shunting314/fd60fe11d1f844c6db76aba7b06811bc
  
      It shows that the output of the graph is the mul node which contains
      the update we applied to the base tensor.
      """
  
      @torch.compile
      def f(x):
          y = x.view(3, 2)
          x.mul_(2)
          return y
  
      x = torch.ones(2, 3).cuda()
      y = f(x)
      self.assertTrue(torch.equal(y, torch.ones(3, 2).cuda() * 2))
  
imports: import copy
  import os
  import random
  import torch
  from torch import nn
  from torch._dynamo.test_case import run_tests, TestCase
  from torch._dynamo.utils import same
  from torch._inductor import config
  from torch.testing._internal.inductor_utils import HAS_CUDA
label_desc: Use image node_id 11 for calling the TestLayoutOptim obj's underlying member method code with example usage: obj.test_mutate_base() and returns: y