mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[*.py] Rename "Arguments:" to "Args:" (#49736)
Summary: I've written custom parsers and emitters for everything from docstrings to classes and functions. However, I recently came across an issue when I was parsing/generating from the TensorFlow codebase: inconsistent use of `Args:` and `Arguments:` in its docstrings. ```sh (pytorch#c348fae)$ for name in 'Args:' 'Arguments:'; do printf '%-10s %04d\n' "$name" "$(rg -IFtpy --count-matches "$name" | paste -s -d+ -- | bc)"; done Args: 1095 Arguments: 0336 ``` It is easy enough to extend my parsers to support both variants, however it looks like `Arguments:` is wrong anyway, as per: - https://google.github.io/styleguide/pyguide.html#doc-function-args @ [`ddccc0f`](https://github.com/google/styleguide/blob/ddccc0f/pyguide.md) - https://chromium.googlesource.com/chromiumos/docs/+/master/styleguide/python.md#describing-arguments-in-docstrings @ [`9fc0fc0`](https://chromium.googlesource.com/chromiumos/docs/+/9fc0fc0/styleguide/python.md) - https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html @ [`c0ae8e3`](https://github.com/sphinx-contrib/napoleon/blob/c0ae8e3/docs/source/example_google.rst) Therefore, only `Args:` is valid. This PR replaces them throughout the codebase. PS: For related PRs, see tensorflow/tensorflow/pull/45420 PPS: The trackbacks automatically appearing below are sending the same changes to other repositories in the [PyTorch](https://github.com/pytorch) organisation. Pull Request resolved: https://github.com/pytorch/pytorch/pull/49736 Reviewed By: albanD Differential Revision: D25710534 Pulled By: soumith fbshipit-source-id: 61e8ff01abb433e9f78185c2d1d0cbd7c22c1619
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9c64b9ffba
commit
e6779d4357
@ -76,7 +76,7 @@ def _polynomial_value(poly, x, zero_power, transition):
|
||||
"""
|
||||
A generic method for computing poly(x) using the Horner's rule.
|
||||
|
||||
Arguments:
|
||||
Args:
|
||||
poly (Tensor): the (possibly batched) 1D Tensor representing
|
||||
polynomial coefficients such that
|
||||
poly[..., i] = (a_{i_0}, ..., a{i_n} (==1)), and
|
||||
@ -384,7 +384,7 @@ def lobpcg(A: Tensor,
|
||||
we do the following symmetrization map: `A -> (A + A.t()) / 2`.
|
||||
The map is performed only when the `A` requires gradients.
|
||||
|
||||
Arguments:
|
||||
Args:
|
||||
|
||||
A (Tensor): the input tensor of size :math:`(*, m, m)`
|
||||
|
||||
@ -925,7 +925,7 @@ class LOBPCG(object):
|
||||
matrix product `D M` with element-wise product `M *
|
||||
d`. Also, creating the diagonal matrix `D` is avoided.
|
||||
|
||||
Arguments:
|
||||
Args:
|
||||
S (Tensor): the matrix basis for the search subspace, size is
|
||||
:math:`(m, n)`.
|
||||
|
||||
@ -957,7 +957,7 @@ class LOBPCG(object):
|
||||
modification of the corresponding algorithm
|
||||
introduced in [StathopolousWu2002].
|
||||
|
||||
Arguments:
|
||||
Args:
|
||||
|
||||
U (Tensor) : initial approximation, size is (m, n)
|
||||
drop (bool) : when True, drop columns that
|
||||
@ -1023,7 +1023,7 @@ class LOBPCG(object):
|
||||
.. note:: If all U columns are B-collinear to V then the
|
||||
returned tensor U will be empty.
|
||||
|
||||
Arguments:
|
||||
Args:
|
||||
|
||||
U (Tensor) : initial approximation, size is (m, n)
|
||||
V (Tensor) : B-orthogonal external basis, size is (m, k)
|
||||
|
Reference in New Issue
Block a user