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

Before Change


        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


        if len(set(seq.shape[1:] for seq in seqs)) != 1:
            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]
            output[region] = arr
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

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: google/unrestricted-adversarial-examples
Commit Name: 7a8be4139a3d1f3968081728375c4621285ec3fe
Time: 2018-08-25
Author: nottombrown@gmail.com
File Name: unrestricted_advex/eval_kit/eval_with_attacks.py
Class Name:
Method Name: plot_confident_error_rate


Project Name: autoreject/autoreject
Commit Name: e6dc6899d0aa846636c48562c79b161347c35235
Time: 2019-06-04
Author: mainakjas@gmail.com
File Name: autoreject/ransac.py
Class Name: Ransac
Method Name: fit