summaryrefslogtreecommitdiff
path: root/torch/nn/_VF.py
blob: b41809ca7b231e4b2c3e66b85f4cbea25cdf7e9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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__)