docstr: The GraphModule passed to GraphLowering init method is like:
  https://gist.github.com/shunting314/07228313fd017e2267101ff32edc6d64
  
  It shows that we will call copy_ to update the argument in the end. This
  guarantees the correctnesss.
docstr_tok: ["The","GraphModule","passed","to","GraphLowering","init","method","is","like",":","https",":","\/\/gist.github.com\/shunting314\/07228313fd017e2267101ff32edc6d64","It","shows","that","we","will","call","copy_","to","update","the","argument","in","the","end",".","This","guarantees","the","correctnesss","."]
code: def test_mutate_view(self):
      """
      The GraphModule passed to GraphLowering init method is like:
      https://gist.github.com/shunting314/07228313fd017e2267101ff32edc6d64
  
      It shows that we will call copy_ to update the argument in the end. This
      guarantees the correctnesss.
      """
  
      @torch.compile
      def f(x):
          y = x.view(3, 2)
          y.mul_(2)
  
      x = torch.ones(2, 3).cuda()
      f(x)
      self.assertTrue(torch.equal(x, torch.ones(2, 3).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 10 for calling the TestLayoutOptim obj's underlying member method code with example usage: obj.test_mutate_view() without return types