[JIT] fix resolving of functions in torch/functional. fix compilation of torch.stft (#33504)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/33504

Fix resolution fo functions that are bound onto torch in torch/functional.py. This does not fix compilation of all of those functions, those will be done in follow ups. Does torch.stft as a start.

Fixes #21478

Test Plan: Imported from OSS

Differential Revision: D20014591

Pulled By: eellison

fbshipit-source-id: bb362f1b5479adbb890e72a54111ef716679d127
This commit is contained in:
Elias Ellison
2020-02-26 18:28:47 -08:00
committed by Facebook Github Bot
parent 057fd5e10d
commit fddf73250d
9 changed files with 35 additions and 10 deletions

14
torch/_VF.py Normal file
View File

@ -0,0 +1,14 @@
import torch
import sys
import types
class VFModule(types.ModuleType):
def __init__(self, name):
super(VFModule, self).__init__(name)
self.vf = torch._C._VariableFunctions
def __getattr__(self, attr):
return getattr(self.vf, attr)
sys.modules[__name__] = VFModule(__name__)