[dynamo] Fix bug with torch._dynamo.skip (#98862)
Summary
* Fixed an issue with `skip`
* Also removed some tests from test_misc.py and moved them to test_decorators.py as test_misc.py is becoming a dumping ground.
~~~
# Code - fn1 was not getting skipped earlier
def fn2(x):
return x.sin()
@torch._dynamo.skip
def fn1(x):
x = x.sigmoid()
return fn2(x.cos())
def fn(x):
return fn1(x.tan())
# Extracted graph
def forward(self, L_x_ : torch.Tensor):
l_x_ = L_x_
tan = l_x_.tan(); l_x_ = None
return (tan,)
def forward(self, L_x_ : torch.Tensor):
l_x_ = L_x_
sin = l_x_.sin(); l_x_ = None
return (sin,)
~~~
Pull Request resolved: https://github.com/pytorch/pytorch/pull/98862
Approved by: https://github.com/ezyang, https://github.com/jansel