0ab5b005164cddccbf7c8a3d66ff6707333de80b,torch_geometric/utils/matmul.py,,matmul,#Any#Any#Any#,6
Before Change
row = row if torch.is_tensor(tensor) else Variable(row)
output_col = edge_attr.unsqueeze(-1) * tensor[col]
output = new(output_col, num_nodes, dim).fill_(0)
row_expand = row.unsqueeze(-1).expand_as(output_col)
output.scatter_add_(0, row_expand, output_col)
return output
After Change
row, col = index
out_col = value.unsqueeze(-1) * tensor[col]
out = scatter_add(out_col, row, dim=0, dim_size=tensor.size(0))
return out
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: rusty1s/pytorch_geometric
Commit Name: 0ab5b005164cddccbf7c8a3d66ff6707333de80b
Time: 2018-05-07
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/utils/matmul.py
Class Name:
Method Name: matmul
Project Name: pytorch/fairseq
Commit Name: c2165224d198450a3b4329ae099a772aa65d51c5
Time: 2019-10-08
Author: changhan@fb.com
File Name: fairseq/models/levenshtein_transformer.py
Class Name: LevenshteinTransformerModel
Method Name: forward_decoder