mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Removed direct doc formatting
Fixes #76034
This does not make python remove all `__doc__` because in some places `__doc__` is assigned to a string.
Example:
04b3313379/torch/nn/modules/conv.py (L174-L233)
Since there are quite a few of these, I will add all of them together in this PR later. (Basically still a lot of docstring will persist even with `-OO` enabled.)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76619
Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
76916ccf81
commit
f92cddd890
@ -470,7 +470,8 @@ def method_factory(method_name, docstring):
|
||||
def method(self, *args, **kwargs):
|
||||
return getattr(super(RRef, self), method_name)(*args, **kwargs)
|
||||
|
||||
method.__doc__ = docstring
|
||||
if method.__doc__:
|
||||
method.__doc__ = docstring
|
||||
return method
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user