mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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
15 lines
310 B
Python
15 lines
310 B
Python
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__)
|