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]( |
||
|---|---|---|
| .. | ||
| mobile | ||
| __init__.py | ||
| _async.py | ||
| _builtins.py | ||
| _check.py | ||
| _freeze.py | ||
| _fuser.py | ||
| _logging.py | ||
| _monkeytype_config.py | ||
| _pickle.py | ||
| _recursive.py | ||
| _script.py | ||
| _serialization.py | ||
| _state.py | ||
| _trace.py | ||
| annotations.py | ||
| frontend.py | ||
| quantized.py | ||
| supported_ops.py | ||
| unsupported_tensor_ops.py | ||