e6d500b7c29066efbfe4cb7ab0e001cb624ad694,models/shift_net/shiftnet_model.py,ShiftNetModel,set_input,#ShiftNetModel#,114

Before Change


        // directly load mask offline
        // TODO: make masks variant each image in a batch
        self.mask_global = input["M"].to(self.device).byte()
        self.mask_global = self.mask_global.narrow(0,0,1).narrow(1,0,1)

        // create mask online
        if not self.opt.offline_loading_mask:

After Change


                self.mask_global = self.create_random_mask().type_as(self.mask_global).view(1, *self.mask_global.size()[-3:])
                // As generating random masks online are computation-heavy
                // So just generate one ranodm mask for a batch images.
                self.mask_global = self.mask_global.expand(self.opt.batchSize, *self.mask_global.size()[-3:])
            else:
                raise ValueError("Mask_type [%s] not recognized." % self.opt.mask_type)
        // For loading mask offline, we also need to change "opt.mask_type" and "opt.mask_sub_type"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: Zhaoyi-Yan/Shift-Net_pytorch
Commit Name: e6d500b7c29066efbfe4cb7ab0e001cb624ad694
Time: 2019-04-28
Author: yanzhaoyi@outlook.com
File Name: models/shift_net/shiftnet_model.py
Class Name: ShiftNetModel
Method Name: set_input


Project Name: kymatio/kymatio
Commit Name: 5f0a67ce3c2d01a2da19b18f2f0834bb31c35182
Time: 2019-03-02
Author: edouard.oyallon@centralesupelec.fr
File Name: kymatio/scattering2d/backend/backend_torch.py
Class Name: Pad
Method Name: __call__


Project Name: kymatio/kymatio
Commit Name: 5f0a67ce3c2d01a2da19b18f2f0834bb31c35182
Time: 2019-03-02
Author: edouard.oyallon@centralesupelec.fr
File Name: kymatio/scattering2d/backend/backend_skcuda.py
Class Name: Pad
Method Name: __call__