33ef02d09c16aaf5191115d0a6a3d3a9b6242ba1,gpytorch/utils/lanczos.py,,lanczos_tridiag_to_diag,#Any#,154

Before Change


    if t_mat.size(-1) < 64:
        orig_device = t_mat.device
        retr = torch.symeig(t_mat.cpu(), eigenvectors=True)
        return (r.to(orig_device) for r in retr)
    else:
        return torch.symeig(t_mat, eigenvectors=True)

After Change


    evals, evecs = retr
    mask = evals.ge(0)
    evecs = evecs * mask.type_as(evecs).unsqueeze(-2)
    evals = evals.masked_fill_(~mask, 1)

    return evals.to(orig_device), evecs.to(orig_device)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 33ef02d09c16aaf5191115d0a6a3d3a9b6242ba1
Time: 2019-11-08
Author: gardner.jake@gmail.com
File Name: gpytorch/utils/lanczos.py
Class Name:
Method Name: lanczos_tridiag_to_diag


Project Name: pytorch/fairseq
Commit Name: 8db7b1c7f8af2d8158584f1ea7f2aaf8f4116f11
Time: 2019-07-17
Author: taylanbil@google.com
File Name: fairseq/criterions/label_smoothed_cross_entropy.py
Class Name: LabelSmoothedCrossEntropyCriterion
Method Name: compute_loss