5e4bcd2876408cc4fabfaee595928306f90f555d,torch_geometric/transform/target_indegree.py,TargetIndegree,__call__,#TargetIndegree#Any#,7
Before Change
_, 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)
degree /= degree.max()
degree = degree[col]
if data.weight is None:
data.weight = degree
else:
degree, weight = degree.unsqueeze(1), data.weight.unsqueeze(1)
data.weight = torch.cat([degree, weight], dim=1)
return data
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: 7
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: elbayadm/attn2d
Commit Name: 27568a7ebed1a35f08ac0390f35b3de9b8dad0dd
Time: 2019-11-13
Author: myleott@fb.com
File Name: fairseq/models/levenshtein_transformer.py
Class Name: LevenshteinTransformerModel
Method Name: initialize_output_tokens