Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 3506e3f

Browse files
authored
ensure parameters that are actual dictionaries get logged (#4697)
1 parent eb7f256 commit 3506e3f

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5353
if the "href" part of the link (the part inside the `()`) was on a new line.
5454
- Changed how gradients are zeroed out with an optimization. See [this video from NVIDIA](https://www.youtube.com/watch?v=9mS1fIYj1So)
5555
at around the 9 minute mark.
56+
- Fixed a bug where parameters to a `FromParams` class that are dictionaries wouldn't get logged
57+
when an instance is instantiated `from_params`.
5658

5759

5860
## [v1.1.0](https://github.com/allenai/allennlp/releases/tag/v1.1.0) - 2020-09-08

allennlp/common/from_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def constructor(**kwargs):
494494
else:
495495
# Pass it on as is and hope for the best. ¯\_(ツ)_/¯
496496
if isinstance(popped_params, Params):
497-
return popped_params.as_dict(quiet=True)
497+
return popped_params.as_dict()
498498
return popped_params
499499

500500

allennlp/common/params.py

-6
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,6 @@ def log_recursively(parameters, history):
383383
else:
384384
logger.info(f"{history}{key} = {value}")
385385

386-
logger.info(
387-
"Converting Params object to dict; logging of default "
388-
"values will not occur when dictionary parameters are "
389-
"used subsequently."
390-
)
391-
logger.info("CURRENTLY DEFINED PARAMETERS: ")
392386
log_recursively(self.params, self.history)
393387
return params_as_dict
394388

0 commit comments

Comments
 (0)