d6d7cb7db51776b026514a1a2caa4073b9e998ad,thinc/backends/ops.py,Ops,pad,#Ops#,115

Before Change


            raise ValueError("Cannot pad sequences that differ on other dimensions")
        shape = [len(seqs)]
        // Find the maximum dimension along each axis. That"s what we"ll pad to.
        dim_sizes = zip(*[seq.shape for seq in seqs])
        shape.extend(max(sizes) for sizes in dim_sizes)
        // Now copy the data into our new buffer.
        output: Array = self.alloc(tuple(shape), dtype=seqs[0].dtype)
        for i, arr in enumerate(seqs):

After Change


            raise ValueError("Cannot pad sequences that differ on other dimensions")
        // Find the maximum dimension along each axis. That"s what we"ll pad to.
        shapes = [tuple(s.shape) for s in seqs]
        dim_sizes = zip(*[shape for shape in shapes])
        max_dims = [max(sizes) for sizes in dim_sizes]
        final_shape = (len(seqs),) + tuple(max_dims)
        output = self.alloc(final_shape, dtype=seqs[0].dtype)
        for i, arr in enumerate(seqs):
            region = [i] + [slice(0, dim) for dim in arr.shape]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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: pad


Project Name: THUNLP-MT/THUMT
Commit Name: 6880ee0c2c46573cfc77444e2970aa8695140076
Time: 2019-02-14
Author: playinf@stu.xmu.edu.cn
File Name: thumt/scripts/shuffle_corpus.py
Class Name:
Method Name: main


Project Name: sentinel-hub/eo-learn
Commit Name: 084d3cb097d1eacea365bf0612ce11928ad22414
Time: 2019-11-29
Author: matic.lubej@sinergise.com
File Name: core/eolearn/core/eodata.py
Class Name: EOPatch
Method Name: load_aws