d6d7cb7db51776b026514a1a2caa4073b9e998ad,thinc/backends/ops.py,Ops,list2padded,#Ops#,145

Before Change


        nB = len(seqs)
        nS = max([len(seq) for seq in seqs])
        arr: Array3d = self.alloc_f3d(nB, nS, seqs[0].shape[1])
        for arr_i, (length, seqs_i) in enumerate(lengths_indices):
            arr[arr_i, :length] = self.asarray(seqs[seqs_i])
        arr = self.as_contig(arr.transpose((1, 0, 2)))
        // Build a lookup table so we can find how big the batch is at point t.
        batch_size_at_t_ = numpy.zeros(nS, dtype="i")

After Change


        lengths_ = [length for length, i in lengths_indices]
        nB = len(seqs)
        nS = max([len(seq) for seq in seqs])
        arr: Array3d = self.pad(seqs)
        // Build a lookup table so we can find how big the batch is at point t.
        batch_size_at_t_ = numpy.zeros(nS, dtype="i")
        batch_size_at_t_ += 1
        i = len(lengths_)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: explosion/thinc
Commit Name: d6d7cb7db51776b026514a1a2caa4073b9e998ad
Time: 2020-01-19
Author: honnibal+gh@gmail.com
File Name: thinc/backends/ops.py
Class Name: Ops
Method Name: list2padded


Project Name: maciejkula/spotlight
Commit Name: 396303a7b84fe4f8b304a5878c487ff0b3a16097
Time: 2017-07-08
Author: maciej.kula@gmail.com
File Name: spotlight/sequence/representations.py
Class Name: CNNNet
Method Name: user_representation


Project Name: explosion/thinc
Commit Name: d6d7cb7db51776b026514a1a2caa4073b9e998ad
Time: 2020-01-19
Author: honnibal+gh@gmail.com
File Name: thinc/backends/jax_ops.py
Class Name: JaxOps
Method Name: list2padded