Skip to content

Commit ff8c3fd

Browse files
zaffacebook-github-bot
zaf
authored andcommitted
Adding the quantized namespace to torch.nn and importing it from torch (pytorch#21600)
Summary: Stack:     :black_circle:  **pytorch#21600 Adding the quantized namespace to torch**  [:yellow_heart:](https://our.intern.facebook.com/intern/diff/D15742149/) Add nn.quantized name space to torch Pull Request resolved: pytorch#21600 Differential Revision: D15742149 Pulled By: zafartahirov fbshipit-source-id: 60dede12c81861f369d208b06f5b68e9384312f6
1 parent 9a1dc43 commit ff8c3fd

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

torch/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ def manager_path():
295295
import torch.autograd
296296
from torch.autograd import no_grad, enable_grad, set_grad_enabled # noqa: F401
297297
import torch.nn
298+
import torch.nn.quantized
298299
import torch.optim
299300
import torch.multiprocessing
300301
import torch.sparse

torch/nn/quantized/__init__.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
from . import functional # noqa: F401
1+
r"""
2+
The quantized module contains the data structures and ops for implementation of
3+
the quantized models.
4+
"""
5+
6+
from torch.nn.quantized.functional import add_relu
7+
from torch.nn.quantized.functional import relu
8+
9+
__all__ = [
10+
'add_relu',
11+
'relu'
12+
]

0 commit comments

Comments
 (0)