9b40999eece2201a7855307c1dc85e1f4cf07c0d,fairseq/options.py,,parse_args_and_arch,#Any#Any#Any#,77

Before Change


    // Add *-specific args to parser.
    if hasattr(args, "criterion"):
        CRITERION_REGISTRY[args.criterion].add_args(parser)
    if hasattr(args, "optimizer"):
        OPTIMIZER_REGISTRY[args.optimizer].add_args(parser)
    if hasattr(args, "lr_scheduler"):
        LR_SCHEDULER_REGISTRY[args.lr_scheduler].add_args(parser)
    if hasattr(args, "task"):
        TASK_REGISTRY[args.task].add_args(parser)

After Change



    // Add *-specific args to parser.
    from fairseq.registry import REGISTRIES
    for registry_name, REGISTRY in REGISTRIES.items():
        choice = getattr(args, registry_name, None)
        if choice is not None:
            cls = REGISTRY["registry"][choice]
            if hasattr(cls, "add_args"):
                cls.add_args(parser)
    if hasattr(args, "task"):
        from fairseq.tasks import TASK_REGISTRY
        TASK_REGISTRY[args.task].add_args(parser)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: elbayadm/attn2d
Commit Name: 9b40999eece2201a7855307c1dc85e1f4cf07c0d
Time: 2019-06-11
Author: myleott@fb.com
File Name: fairseq/options.py
Class Name:
Method Name: parse_args_and_arch


Project Name: pytorch/fairseq
Commit Name: cf1c64a5f7cffe7a362cc772752f8f226fb04f22
Time: 2018-06-15
Author: myleott@fb.com
File Name: train.py
Class Name:
Method Name: validate