Skip to content

Why does FrozenDict.pop() return two values? #1333

Answered by andsteing
andsteing asked this question in Q&A
Discussion options

You must be logged in to vote

Documentation on RTD: https://flax.readthedocs.io/en/latest/flax.core.frozen_dict.html

FrozenDict is our implementation of a Mapping that is immutable and suitable for use with parameters and other state variables. Additionally to function to convert between dict (and other Mapping) to FrozenDict via .freeze() and .unfreeze(), the FrozenDict class also implements a .pop() method that is similar to dict.pop() but with the difference that the updated FrozenDict is returned before the value that is popped (note that the default dict.pop() does this update in-place).

Replies: 1 comment

Comment options

andsteing
May 20, 2021
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by marcvanzee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant