Commit 647e87ef authored by Mircea Cimpoi's avatar Mircea Cimpoi Committed by Facebook GitHub Bot
Browse files

Make `trainer` class check less restrictive

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/508

Avoid unnecessary restriction to base class Trainer. Subclasses of `SimpleTrainer` would work as well.

Reviewed By: wat3rBro

Differential Revision: D44221069

fbshipit-source-id: a666977b2073b4525b4c6940c121f6b05466e5d7
parent 232dad22
......@@ -665,8 +665,11 @@ def _reset_qat_data_loader_if_needed(cfg, trainer, build_loader_func):
old_bs, new_bs
)
)
# This method assumes the data loader can be replaced from trainer
assert trainer.__class__ == SimpleTrainer
assert isinstance(
trainer, SimpleTrainer
), "Trainer needs to be a subclass of SimpleTrainer to support resetting the dataloader"
trainer.reset_data_loader(lambda: build_loader_func(loader_cfg))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment