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
bcc4f9d6
Commit
bcc4f9d6
authored
Apr 20, 2021
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Apr 20, 2021
Browse files
Update `Config` class doc to warn the auto conversion of dict to `Config` class.
PiperOrigin-RevId: 369588823
parent
296d7494
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
official/modeling/hyperparams/base_config.py
official/modeling/hyperparams/base_config.py
+5
-1
No files found.
official/modeling/hyperparams/base_config.py
View file @
bcc4f9d6
...
...
@@ -30,11 +30,15 @@ from official.modeling.hyperparams import params_dict
class
Config
(
params_dict
.
ParamsDict
):
"""The base configuration class that supports YAML/JSON based overrides.
Because of YAML/JSON serialization limitations, some semantics of dataclass
are not supported:
* It recursively enforces a allowlist of basic types and container types, so
it avoids surprises with copy and reuse caused by unanticipated types.
*
I
t converts
d
ict to Config even within sequences,
*
Warning: i
t converts
D
ict to
`
Config
`
even within sequences,
e.g. for config = Config({'key': [([{'a': 42}],)]),
type(config.key[0][0][0]) is Config rather than dict.
If you define/annotate some field as Dict, the field will convert to a
`Config` instance and lose the dictionary type.
"""
# It's safe to add bytes and other immutable types here.
...
...
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