[quant][refactor] Remove the base class from __all__

In general, if we are expecting the users to use the base class,
such as `_ConvNd`, we should rename it to something like
`BaseConv`. However, because this base class is only used inside of the
AO packages, there is no need to expose it to the users.

Test Plan:

```
python test/test_quantization.py
python test/test_module_init.py
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/77344

Approved by: https://github.com/jerryzh168
This commit is contained in:
Zafar 2022-05-18 15:43:04 -07:00 committed by PyTorch MergeBot
parent 19701267f3
commit 9d44b3d110
3 changed files with 1 additions and 4 deletions

View file

@ -365,7 +365,6 @@ def generate_tests(test_cls, constructor_arg_db):
torch.nn.Module,
torch.nn.Container, # deprecated
torch.nn.NLLLoss2d, # deprecated
torch.nn.quantized._ConvNd, # base class in __all__ for some reason
# TODO: Remove these 2 from this list once the ASan issue is fixed.
# See https://github.com/pytorch/pytorch/issues/55396
torch.nn.quantized.Embedding,

View file

@ -6,7 +6,7 @@ from .dropout import Dropout
from .batchnorm import BatchNorm2d, BatchNorm3d
from .normalization import LayerNorm, GroupNorm, InstanceNorm1d, \
InstanceNorm2d, InstanceNorm3d
from .conv import _ConvNd, Conv1d, Conv2d, Conv3d
from .conv import Conv1d, Conv2d, Conv3d
from .conv import ConvTranspose1d, ConvTranspose2d, ConvTranspose3d
from .linear import Linear
from .embedding_ops import Embedding, EmbeddingBag
@ -91,7 +91,6 @@ class DeQuantize(torch.nn.Module):
__all__ = [
'BatchNorm2d',
'BatchNorm3d',
'_ConvNd',
'Conv1d',
'Conv2d',
'Conv3d',

View file

@ -31,7 +31,6 @@ MODULES_TO_SKIP: Set[Type] = {
torch.nn.Module, # abstract base class
torch.nn.Container, # deprecated
torch.nn.NLLLoss2d, # deprecated
torch.nn.quantized.modules._ConvNd, # abstract base class
torch.nn.quantized.MaxPool2d, # aliases to nn.MaxPool2d
}