ec1c64cf6d6e635fa80e9b4f55bda7ece84b5d81,thinc/wire.py,,with_flatten,#Any#Any#Any#,195

Before Change


        X = layer(layer.ops.flatten(seqs_in, pad=pad))
        return layer.ops.unflatten(X, lengths, pad=pad)

    model = layerize(begin_update, predict=predict)
    model._layers.append(layer)
    model.on_data_hooks.append(_with_flatten_on_data)
    model.name = "flatten"
    return model


def _with_flatten_on_data(model, X, y):
    X = model.ops.flatten(X)

After Change


        X = layer(layer.ops.flatten(seqs_in, pad=pad))
        return layer.ops.unflatten(X, lengths, pad=pad)
    
    return wrap(with_flatten_forward, layer, predict=with_flatten_predict, 
        name=f"with_flatten-{layer.name}", on_data_hooks=[_with_flatten_on_data])


def _with_flatten_on_data(model, X, y):
    X = model.ops.flatten(X)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: explosion/thinc
Commit Name: ec1c64cf6d6e635fa80e9b4f55bda7ece84b5d81
Time: 2019-12-26
Author: honnibal+gh@gmail.com
File Name: thinc/wire.py
Class Name:
Method Name: with_flatten


Project Name: pantsbuild/pants
Commit Name: 71462da0cdb88c88539afefc4c01ff810b994200
Time: 2015-09-08
Author: john.sirois@gmail.com
File Name: contrib/go/src/python/pants/contrib/go/register.py
Class Name:
Method Name: build_file_aliases


Project Name: nipy/dipy
Commit Name: 93c9bd8e475b2d5db1b76c5c1fe433c0d6226a0b
Time: 2012-03-06
Author: Bago.Amirbekian@ucsf.edu
File Name: dipy/reconst/dti.py
Class Name: Tensor
Method Name: _getD