72cc9dd414ee4befbadf9bd3e4804cb2e0908e9c,allennlp/nn/initializers.py,InitializerApplicator,from_params,#Any#Any#,86

Before Change


                def curried_initializer(tensor: torch.Tensor):
                    return Initializer.by_name(initializer_type)(tensor, **init_params)  // type: ignore
                // pylint: enable=cell-var-from-loop
                instantiated_initializers[name] = curried_initializer  // type: ignore
        try:
            default = instantiated_initializers.pop("default")
        except KeyError:

After Change


        initializers = {}
        for name, initializer_params in all_initializer_params.items():
            initializers[name] = Initializer.from_params(initializer_params)
        default = initializers.pop("default", Initializer.by_name("normal")())
        exclude_regexes = params.pop("exclude", [])
        return InitializerApplicator(initializers, default, exclude_regexes)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: allenai/allennlp
Commit Name: 72cc9dd414ee4befbadf9bd3e4804cb2e0908e9c
Time: 2017-08-07
Author: mattg@allenai.org
File Name: allennlp/nn/initializers.py
Class Name: InitializerApplicator
Method Name: from_params


Project Name: pcyin/tranX
Commit Name: 870e17a6857365bec3035bfece2e77b525288b01
Time: 2018-11-20
Author: pcyin@cs.cmu.edu
File Name: exp.py
Class Name:
Method Name: train


Project Name: pcyin/tranX
Commit Name: 870e17a6857365bec3035bfece2e77b525288b01
Time: 2018-11-20
Author: pcyin@cs.cmu.edu
File Name: exp.py
Class Name:
Method Name: test