23a41cfcac5976cab47133fed2f6f53d061e9173,tensorlayer/layers/core.py,Layer,__init__,#Layer#Any#Any#,118

Before Change


        self.act = act if act not in [None, tf.identity] else None

        global _global_layer_index
        if name is None:
            name = "layer%d" % _global_layer_index
        _global_layer_index += 1
            // raise ValueError(
            //     "Layer must have a name. \n    TODO: Hao Dong: could we automatically add layer name when name=None e.g. layer0, layer1, batchnorm, layer3, layer4... "
            // )

After Change


        //// Hao Dong: automatically add layer type as the prefix of the layers
        global _global_layer_name_dict
        if name is None:
            prefix = self.__class__.__name__.lower()
            if prefix in _global_layer_name_dict.keys():
                _global_layer_name_dict[prefix] += 1
                name = prefix + "_" + str(_global_layer_name_dict[prefix])
            else:
                _global_layer_name_dict[prefix] = 0
                name = prefix
        // _global_layer_index += 1
            // raise ValueError(
            //     "Layer must have a name. \n    TODO: Hao Dong: could we automatically add layer name when name=None e.g. layer0, layer1, batchnorm, layer3, layer4... "
            // )

        // FIXME: double check needed: the scope name may be deprecated in TF2
        // scope_name = tf.get_variable_scope().name
        // self.name = scope_name + "/" + name if scope_name else name
        self.name = name

        // Layer input outputs
        self.inputs = None
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: tensorlayer/tensorlayer
Commit Name: 23a41cfcac5976cab47133fed2f6f53d061e9173
Time: 2019-01-16
Author: dhsig552@163.com
File Name: tensorlayer/layers/core.py
Class Name: Layer
Method Name: __init__


Project Name: keras-team/autokeras
Commit Name: 71432d1890209628e189edf04d7d623160943718
Time: 2019-12-18
Author: 33369174+Davidsirui@users.noreply.github.com
File Name: autokeras/hypermodel/preprocessor.py
Class Name: TextToNgramVector
Method Name: transform


Project Name: deepmipt/DeepPavlov
Commit Name: cb0c025ab87216d35b68a2b4b36d61621acd76ba
Time: 2018-01-31
Author: arkhipov@yahoo.com
File Name: deeppavlov/models/ner/slotfill.py
Class Name: DstcSlotFillingNetwork
Method Name: infer