5e4bcd2876408cc4fabfaee595928306f90f555d,torch_geometric/transform/target_indegree.py,TargetIndegree,__call__,#TargetIndegree#Any#,7
Before Change
def __call__(self, data):
_, col = data.index
zero = torch.zeros(data.num_nodes, out=col.new().float())
one = torch.ones(col.size(0), out=zero.new())
degree = zero.scatter_add_(0, col, one)
After Change
if pseudo is not None and self.cat:
pseudo = pseudo.unsqueeze(-1) if pseudo.dim() == 1 else pseudo
deg = deg.type_as(pseudo)
data.weight = torch.cat([pseudo, deg], dim=-1)
else:
data.weight = deg
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: rusty1s/pytorch_geometric
Commit Name: 5e4bcd2876408cc4fabfaee595928306f90f555d
Time: 2018-05-07
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transform/target_indegree.py
Class Name: TargetIndegree
Method Name: __call__
Project Name: inferno-pytorch/inferno
Commit Name: 5e46e590db971af21d1c71260ce885431718e2d3
Time: 2017-08-25
Author: nasim.rahaman@iwr.uni-heidelberg.de
File Name: inferno/extensions/metrics/categorical.py
Class Name: CategoricalError
Method Name: forward
Project Name: facebookresearch/ParlAI
Commit Name: 0a229d20be8b313e9fe46cc664156fed6e208936
Time: 2020-03-05
Author: roller@fb.com
File Name: parlai/agents/transformer/modules.py
Class Name: BasicAttention
Method Name: forward