14c0cf773f514788aca6b935298fa186890eecc1,test.py,,,#,16

Before Change


        target = Variable(ToTensor()(target))
        if torch.cuda.is_available():
            image = image.unsqueeze(0).cuda()
            target = target.unsqueeze(0).cuda()

        out = model(image)
        mse = ((target - out) ** 2).mean()

After Change


        target = Image.open(target_path + image_name)
        target = Variable(ToTensor()(target))
        if torch.cuda.is_available():
            image = image.cuda()
            target = target.cuda()

        out = model(image.unsqueeze(0))[0]
        mse = ((target - out) ** 2).mean()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: leftthomas/SRGAN
Commit Name: 14c0cf773f514788aca6b935298fa186890eecc1
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: test.py
Class Name:
Method Name:


Project Name: mozilla/TTS
Commit Name: 70beccf32865cef3510b5c3118b799268b50c8b3
Time: 2018-05-16
Author: egolge@mozilla.com
File Name: notebooks/utils.py
Class Name:
Method Name: create_speech


Project Name: facebookresearch/SentEval
Commit Name: 89b8ae52d7695aee9b0e730cdd196a5deb1ada6c
Time: 2017-07-19
Author: aconneau@fb.com
File Name: examples/models.py
Class Name: BLSTMEncoder
Method Name: forward