Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
cc9357f9
"tests/vscode:/vscode.git/clone" did not exist on "023b0e0d5535eb80f174713ff1d1876519a7f943"
Commit
cc9357f9
authored
Jan 22, 2021
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Jan 22, 2021
Browse files
Respectful code cleanup
PiperOrigin-RevId: 353315689
parent
624ac92d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
official/modeling/hyperparams/base_config.py
official/modeling/hyperparams/base_config.py
+1
-1
official/utils/testing/scripts/ci_sanity.sh
official/utils/testing/scripts/ci_sanity.sh
+9
-9
No files found.
official/modeling/hyperparams/base_config.py
View file @
cc9357f9
...
@@ -30,7 +30,7 @@ from official.modeling.hyperparams import params_dict
...
@@ -30,7 +30,7 @@ from official.modeling.hyperparams import params_dict
class
Config
(
params_dict
.
ParamsDict
):
class
Config
(
params_dict
.
ParamsDict
):
"""The base configuration class that supports YAML/JSON based overrides.
"""The base configuration class that supports YAML/JSON based overrides.
* It recursively enforces a
white
list of basic types and container types, so
* It recursively enforces a
allow
list of basic types and container types, so
it avoids surprises with copy and reuse caused by unanticipated types.
it avoids surprises with copy and reuse caused by unanticipated types.
* It converts dict to Config even within sequences,
* It converts dict to Config even within sequences,
e.g. for config = Config({'key': [([{'a': 42}],)]),
e.g. for config = Config({'key': [([{'a': 42}],)]),
...
...
official/utils/testing/scripts/ci_sanity.sh
View file @
cc9357f9
...
@@ -34,10 +34,10 @@ do_pylint() {
...
@@ -34,10 +34,10 @@ do_pylint() {
# --incremental Performs check on only the python files changed in the
# --incremental Performs check on only the python files changed in the
# last non-merge git commit.
# last non-merge git commit.
# Use this list to
whitelist
pylint errors
# Use this list to
ALLOWLIST
pylint errors
ERROR_
WHITE
LIST
=
""
ERROR_
ALLOW
LIST
=
""
echo
"ERROR_
WHITE
LIST=
\"
${
ERROR_
WHITE
LIST
}
\"
"
echo
"ERROR_
ALLOW
LIST=
\"
${
ERROR_
ALLOW
LIST
}
\"
"
PYLINT_BIN
=
"python3 -m pylint"
PYLINT_BIN
=
"python3 -m pylint"
...
@@ -92,16 +92,16 @@ do_pylint() {
...
@@ -92,16 +92,16 @@ do_pylint() {
N_ERRORS
=
0
N_ERRORS
=
0
while
read
-r
LINE
;
do
while
read
-r
LINE
;
do
IS_
WHITE
LISTED
=
0
IS_
ALLOW
LISTED
=
0
for
WL_REGEX
in
${
ERROR_
WHITE
LIST
}
;
do
for
WL_REGEX
in
${
ERROR_
ALLOW
LIST
}
;
do
if
echo
${
LINE
}
|
grep
-q
"
${
WL_REGEX
}
"
;
then
if
echo
${
LINE
}
|
grep
-q
"
${
WL_REGEX
}
"
;
then
echo
"Found a
whitelist
ed error:"
echo
"Found a
ALLOWLIST
ed error:"
echo
"
${
LINE
}
"
echo
"
${
LINE
}
"
IS_
WHITE
LISTED
=
1
IS_
ALLOW
LISTED
=
1
fi
fi
done
done
if
[[
${
IS_
WHITE
LISTED
}
==
"0"
]]
;
then
if
[[
${
IS_
ALLOW
LISTED
}
==
"0"
]]
;
then
echo
"
${
LINE
}
"
>>
${
NONWL_ERRORS_FILE
}
echo
"
${
LINE
}
"
>>
${
NONWL_ERRORS_FILE
}
echo
""
>>
${
NONWL_ERRORS_FILE
}
echo
""
>>
${
NONWL_ERRORS_FILE
}
((
N_ERRORS++
))
((
N_ERRORS++
))
...
@@ -116,7 +116,7 @@ do_pylint() {
...
@@ -116,7 +116,7 @@ do_pylint() {
cat
"
${
NONWL_ERRORS_FILE
}
"
cat
"
${
NONWL_ERRORS_FILE
}
"
return
1
return
1
else
else
echo
"PASS: No non-
whitelist
ed pylint errors were found."
echo
"PASS: No non-
ALLOWLIST
ed pylint errors were found."
return
0
return
0
fi
fi
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment