57c71199259bc937e5a58770cd3733fd65e0ef84,torch_geometric/utils/to_dense_batch.py,,to_dense_batch,#Any#Any#Any#,5
Before Change
index = torch.arange(batch.size(0), dtype=torch.long, device=x.device)
index = (index - cum_nodes[batch]) + (batch * max_num_nodes)
size = [batch_size * max_num_nodes] + list(x.size())[1:]
batch_x = x.new_full(size, fill_value)
batch_x[index] = x
size = [batch_size, max_num_nodes] + list(x.size())[1:]
After Change
:rtype: (:class:`Tensor`, :class:`LongTensor`)
batch_size = batch[-1].item() + 1
num_nodes = scatter_("add", batch.new_ones(x.size(0)), batch, batch_size)
cum_nodes = torch.cat([batch.new_zeros(1), num_nodes.cumsum(dim=0)])
max_num_nodes = num_nodes.max().item()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: rusty1s/pytorch_geometric
Commit Name: 57c71199259bc937e5a58770cd3733fd65e0ef84
Time: 2019-06-07
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/utils/to_dense_batch.py
Class Name:
Method Name: to_dense_batch
Project Name: facebookresearch/pytext
Commit Name: f5278f68882ebf89a013611c86eb20345e723df2
Time: 2020-04-15
Author: twild@fb.com
File Name: pytext/models/seq_models/seq2seq_model.py
Class Name: Seq2SeqModel
Method Name: forward
Project Name: biolab/orange3
Commit Name: bd73b421daa7d2f8b59dc925ec1b66dce6151e1d
Time: 2015-09-03
Author: ales.erjavec@fri.uni-lj.si
File Name: Orange/widgets/evaluate/owtestlearners.py
Class Name: OWTestLearners
Method Name: _invalidate