Open PetrochukM opened 3 years ago
Also, it'd be helpful to export the kwargs
without get_configured_partial
. Additionally... We can rename get_configured_partial
to get_partial
. A partial by definition is "configured".
The logging can be simplified with something like this... it'll ensure we don't log the same error multiple times.
@functools.lru_cache(maxsize=None)
def call_once(callable_, *args, **kwargs):
"""Call `callable_` only once with `args` and `kwargs` within the same process."""
return callable_(*args, **kwargs)
If a partial
is exported, then it shouldn't trigger warnings of overwriting.
with
statement, that let's you set a configuration temporarily. We could name and talk about this package around the concept of dependency injection.
For some reason, the configuration is able to accept a class
as a key. The config object should only be able to accept methods or functions.
Add a context manager for setting the configuration temporarily. This is especially useful for "context" management. For example, if we are evaluating vs training.
Fix double configuration. When a function is configured twice, it creates all sorts of errors.
Allow setting the configuration, later. So that you can do something like:
configurable(torch.optim.Adam.init)(params) This prevents us from needing to set a global parameter.
For some reason... after transferring the configuration to another process. torch.nn.LayerNorm.__init__
wasn't configured, and there was no warning.
Part of the reason was... that after transferring the configuration, LayerNorm
was no longer configurable
.
It's likely because _code_to_function
requires configurable
to be executed.
Ensure all warnings, and checks are configurable.
Support generators.
Dont print warnings if the args are the same: UserWarning: @configurable: Overwriting configured argument
suffix=.wavin module
run.data._loader.utils.is_normalized_audio_filewith
.wav.
Remove setprofile
since it can be overwritten
We could introduce this package as... Why use YAML for config files? Just use Python.
Clear our skipped configs, when clearing out config
In order to easily create a new process, the configuration should we exported from the old process, and imported into the new process.