c25fa38deb4efc5445f64af3ec17eae0eb660d2f,keras/models.py,Sequential,add,#Sequential#Any#,409

Before Change


                // to the input layer we just created.
                layer(x)

            if len(layer.inbound_nodes) != 1:
                raise ValueError("A layer added to a Sequential model must "
                                 "not already be connected somewhere else. "
                                 "Model received layer " + layer.name +
                                 " which has " +
                                 str(len(layer.inbound_nodes)) +
                                 " pre-existing inbound connections.")

            if len(layer.inbound_nodes[0].output_tensors) != 1:
                raise ValueError("All layers in a Sequential model "
                                 "should have a single output tensor. "
                                 "For multi-output layers, "

After Change


                    // In case of nested models: recover the first layer
                    // of the deepest model to infer input shape and dtype.
                    first_layer = layer.layers[0]
                    while isinstance(first_layer, (Model, Sequential)):
                        first_layer = first_layer.layers[0]
                    batch_shape = first_layer.batch_input_shape
                    dtype = first_layer.dtype
                else:
                    // We were passed a regular layer, and it should
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: keras-team/keras
Commit Name: c25fa38deb4efc5445f64af3ec17eae0eb660d2f
Time: 2017-11-09
Author: francois.chollet@gmail.com
File Name: keras/models.py
Class Name: Sequential
Method Name: add


Project Name: OpenNMT/OpenNMT-py
Commit Name: 1cef0db206bc14c68be02b5bb8c40fccb0568adb
Time: 2018-01-14
Author: srush@sum1gpu02.rc.fas.harvard.edu
File Name: train.py
Class Name: DatasetLazyIter
Method Name: __iter__


Project Name: tensorlayer/tensorlayer
Commit Name: c7e19808f4956666ae23f69364642108a4fe2513
Time: 2019-04-04
Author: ivbensekin@gmail.com
File Name: tensorlayer/layers/core.py
Class Name: Layer
Method Name: __init__