mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Fixes https://github.com/pytorch/pytorch/issues/60397. I'm not sure how aliases are supposed to be implemented, but this is the most basic/direct way, IMO. As a side-effect, this implementation results in a "duplicate" doc entry, inheriting the one from `add_module`:  An alternative implementation could be: ```python def register_module(self, name: str, module: Optional['Module']) -> None: r"""Alias for :func:`add_module`.""" self.add_module(name, module) ``` which results in this documentation:  Questions: 1. Should I replicate the tests? There are two for `add_module`: [test_add_module_raises_error_if_attr_exists]( |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _functions.py | ||
| activation.py | ||
| adaptive.py | ||
| batchnorm.py | ||
| channelshuffle.py | ||
| container.py | ||
| conv.py | ||
| distance.py | ||
| dropout.py | ||
| flatten.py | ||
| fold.py | ||
| instancenorm.py | ||
| lazy.py | ||
| linear.py | ||
| loss.py | ||
| module.py | ||
| normalization.py | ||
| padding.py | ||
| pixelshuffle.py | ||
| pooling.py | ||
| rnn.py | ||
| sparse.py | ||
| transformer.py | ||
| upsampling.py | ||
| utils.py | ||