8e9a026bc34d8409faa572a7144c2d96a7c039ed,tests/models/test_restore.py,,test_model_saving_loading,#Any#,411

Before Change


    if not isinstance(dataloaders, list):
        dataloaders = [dataloaders]

    for dataloader in dataloaders:
        for batch in dataloader:
            break

    x, y = batch
    x = x.view(x.size(0), -1)

    // generate preds before saving model

After Change


    if not isinstance(dataloaders, list):
        dataloaders = [dataloaders]

    batch = next(iter(dataloaders[0]))

    // generate preds before saving model
    model.eval()
    pred_before_saving = model(batch)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: williamFalcon/pytorch-lightning
Commit Name: 8e9a026bc34d8409faa572a7144c2d96a7c039ed
Time: 2021-02-11
Author: rohitgr1998@gmail.com
File Name: tests/models/test_restore.py
Class Name:
Method Name: test_model_saving_loading


Project Name: OpenNMT/OpenNMT-py
Commit Name: 90e5b974a7173ab0bba0990a690e32f25f5b725a
Time: 2019-01-14
Author: benzurdopeters@gmail.com
File Name: tools/embeddings_to_torch.py
Class Name:
Method Name: get_vocabs


Project Name: OpenNMT/OpenNMT-py
Commit Name: 594f66417cf0a2abaead1ce6e5f15a2100441682
Time: 2017-09-21
Author: srush@seas.harvard.edu
File Name: onmt/IO.py
Class Name: ONMTDataset
Method Name: __init__