mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-15 21:00:47 +00:00
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
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| adaptive_weight.py | ||
| add_bias.py | ||
| arc_cosine_feature_map.py | ||
| batch_huber_loss.py | ||
| batch_lr_loss.py | ||
| batch_mse_loss.py | ||
| batch_normalization.py | ||
| batch_sigmoid_cross_entropy_loss.py | ||
| batch_softmax_loss.py | ||
| blob_weighted_sum.py | ||
| bpr_loss.py | ||
| bucket_weighted.py | ||
| build_index.py | ||
| concat.py | ||
| constant_weight.py | ||
| conv.py | ||
| dropout.py | ||
| fc.py | ||
| fc_with_bootstrap.py | ||
| fc_without_bias.py | ||
| feature_sparse_to_dense.py | ||
| functional.py | ||
| gather_record.py | ||
| homotopy_weight.py | ||
| label_smooth.py | ||
| last_n_window_collector.py | ||
| layer_normalization.py | ||
| layers.py | ||
| margin_rank_loss.py | ||
| merge_id_lists.py | ||
| pairwise_similarity.py | ||
| position_weighted.py | ||
| random_fourier_features.py | ||
| reservoir_sampling.py | ||
| sampling_train.py | ||
| sampling_trainable_mixin.py | ||
| select_record_by_context.py | ||
| semi_random_features.py | ||
| sparse_dropout_with_replacement.py | ||
| sparse_feature_hash.py | ||
| sparse_lookup.py | ||
| split.py | ||
| tags.py | ||
| uniform_sampling.py | ||