af02ac9f01bf36b0c278d85636e91ff6b483efb4,tests/test_hooks.py,,_build_demo_runner,#,183

Before Change



def _build_demo_runner():
    model = nn.Linear(2, 1)
    work_dir = osp.join(osp.dirname(osp.abspath(__file__)), "data")
    optimizer = torch.optim.SGD(model.parameters(), lr=0.02, momentum=0.95)

    log_config = dict(
        interval=1, hooks=[

After Change


        work_dir=tmp_dir,
        batch_processor=lambda model, x, **kwargs: {"loss": model(x) - 0},
        optimizer=optimizer,
        logger=logging.getLogger())

    runner.register_logger_hooks(log_config)
    return runner
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: open-mmlab/mmcv
Commit Name: af02ac9f01bf36b0c278d85636e91ff6b483efb4
Time: 2020-04-22
Author: chenkaidev@gmail.com
File Name: tests/test_hooks.py
Class Name:
Method Name: _build_demo_runner


Project Name: pantsbuild/pants
Commit Name: 16246c8a9d84c875208a5e370da87888e799dd96
Time: 2017-11-08
Author: stuhood@twitter.com
File Name: src/python/pants/java/nailgun_executor.py
Class Name: NailgunExecutor
Method Name: __init__


Project Name: bokeh/bokeh
Commit Name: 4dc3640aee8824fa681c36742a6433e327a89247
Time: 2018-10-13
Author: bryanv@anaconda.com
File Name: bokeh/themes/__init__.py
Class Name:
Method Name: