Skip to content

Commit

Permalink
fix: nested dicts in loaders_params/samplers_params overriding (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
bagxi committed Mar 31, 2021
1 parent 2ff687e commit bc008c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Fixed

- minimal requirements issue ([#1147](https://github.com/catalyst-team/catalyst/issues/1147))

- nested dicts in `loaders_params`/`samplers_params` overriding fixed ([#1150](https://github.com/catalyst-team/catalyst/pull/1150))

## [21.03.1] - 2021-03-28

Expand Down
5 changes: 3 additions & 2 deletions catalyst/utils/data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Any, Callable, Dict, Iterable
from collections import OrderedDict
import copy
from functools import partial

import torch
Expand Down Expand Up @@ -120,11 +121,11 @@ def get_loaders_from_params(

default_batch_size = batch_size
default_num_workers = num_workers
loaders_params = loaders_params or {}
loaders_params = copy.deepcopy(loaders_params) or {}
assert isinstance(loaders_params, dict), (
f"`loaders_params` should be a Dict. " f"Got: {loaders_params}"
)
samplers_params = samplers_params or {}
samplers_params = copy.deepcopy(samplers_params) or {}
assert isinstance(
samplers_params, dict
), f"`samplers_params` should be a Dict. Got: {samplers_params}"
Expand Down

0 comments on commit bc008c7

Please sign in to comment.