1f9c7c46c38726817d5ce8f9476e0f8e599ad152,beginner_source/profiler.py,MyModule,forward,#MyModule#Any#Any#,243
Before Change
with profiler.record_function("MASK INDICES"):
threshold = out.sum(axis=1).mean()
hi_idx = (mask > threshold).nonzero(as_tuple=True)
return out, hi_idx
After Change
out = self.linear(input)
with profiler.record_function("MASK INDICES"):
threshold = out.sum(axis=1).mean().item()
hi_idx = np.argwhere(mask.cpu().numpy() > threshold)
hi_idx = torch.from_numpy(hi_idx).cuda()
return out, hi_idx
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: pytorch/tutorials
Commit Name: 1f9c7c46c38726817d5ce8f9476e0f8e599ad152
Time: 2021-02-04
Author: 30845429+ilia-cher@users.noreply.github.com
File Name: beginner_source/profiler.py
Class Name: MyModule
Method Name: forward
Project Name: brian-team/brian2
Commit Name: f8b5a82bde87721f9d5500c00e1505c8fd42f7b4
Time: 2018-08-28
Author: marcel.stimberg@inserm.fr
File Name: brian2/core/functions.py
Class Name:
Method Name: timestep
Project Name: pytorch/tutorials
Commit Name: 9a38f3d417fcc8fb7a1125e77088d8a907daab4b
Time: 2021-01-29
Author: brianjo@fb.com
File Name: beginner_source/profiler.py
Class Name: MyModule
Method Name: forward