2eef37ca549b2460ab3c3979161c727a7deb92df,examples/profile.py,,main,#Any#,38

Before Change


def main(parser):
    opt = parser.parse_args()
    with torch.autograd.profiler.profile(
        use_nvprof=opt["use_nvprof"], trace_path=opt["trace_path"]
    ) as prof:
        train(parser)
    print(prof.total_average())

After Change


        pr.enable()
        train(parser)
        pr.disable()
        s = io.StringIO()
        sortby = "cumulative"
        ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
        ps.print_stats()
        print(s.getvalue())
        if opt["debug"]:
            pdb.set_trace()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: facebookresearch/ParlAI
Commit Name: 2eef37ca549b2460ab3c3979161c727a7deb92df
Time: 2017-10-25
Author: ahm@fb.com
File Name: examples/profile.py
Class Name:
Method Name: main


Project Name: idaholab/raven
Commit Name: 8ad7ca870d68695fd47d9962e565a1e0f7f73f8c
Time: 2021-01-25
Author: paul.talbot@inl.gov
File Name: framework/Models/EnsembleModel.py
Class Name: EnsembleModel
Method Name: __advanceModel


Project Name: estnltk/estnltk
Commit Name: cf5f38373ec0a08518dae7051e53e44c316c166c
Time: 2015-07-28
Author: karl.valliste@gmail.com
File Name: estnltk/prettyprinter/prettyprinter.py
Class Name: PrettyPrinter
Method Name: render