Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeStyle] bump common hooks and remove all tabs in python files #54796

Merged
merged 2 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exclude: |
repos:
# Common hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
Expand All @@ -22,7 +22,7 @@ repos:
- id: trailing-whitespace
files: (.*\.(py|bzl|md|rst|c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps|cmake|yaml|yml|hook)|BUILD|.*\.BUILD|WORKSPACE|CMakeLists\.txt)$
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.1.14
rev: v1.5.1
hooks:
- id: remove-crlf
- id: remove-tabs
Expand All @@ -33,11 +33,9 @@ repos:
name: Tabs remover (Python)
files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
args: [--whitespaces-count, '4']
# Exclude the fluid directory.
# And exclude some unit test files that require tabs.
# Exclude some unit test files that require tabs.
exclude: |
(?x)^(
python/paddle/fluid/.+|
test/dygraph_to_static/test_error.py
)$
- repo: local
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/fluid/nets.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def scaled_dot_product_attention(
queries, keys, values, num_heads=1, dropout_rate=0.0
):
r"""
:api_attr: Static Graph
:api_attr: Static Graph

This interface Multi-Head Attention using scaled dot product.
Attention mechanism can be seen as mapping a query and a set of key-value
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/fluid/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3908,7 +3908,7 @@ def _append_optimize_op(self, block, param_and_grad):

class ModelAverage(Optimizer):
r"""
:api_attr: Static Graph
:api_attr: Static Graph

The ModelAverage optimizer accumulates specific continuous historical parameters
during training. The accumulated historical range can be controlled by the passed
Expand Down