d041ccdc8112fa0d62ee9ad4ab4cecf0fd8e2cf3,torchdiffeq/_impl/misc.py,,_norm,#Any#,75

Before Change



def _norm(x):
    Compute RMS norm.
    if torch.is_tensor(x):
        return x.norm() / (x.numel()**0.5)
    else:
        return torch.sqrt(sum(x_.norm()**2 for x_ in x) / sum(x_.numel() for x_ in x))


def _handle_unused_kwargs(solver, unused_kwargs):
    if len(unused_kwargs) > 0:
        warnings.warn("{}: Unexpected arguments {}".format(solver.__class__.__name__, unused_kwargs))

After Change



def _norm(x):
    Compute RMS norm.
    return x.norm() / math.sqrt(x.numel())


def _select_initial_step(func, t0, y0, order, rtol, atol, f0=None):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: rtqichen/torchdiffeq
Commit Name: d041ccdc8112fa0d62ee9ad4ab4cecf0fd8e2cf3
Time: 2020-07-25
Author: 33688385+patrick-kidger@users.noreply.github.com
File Name: torchdiffeq/_impl/misc.py
Class Name:
Method Name: _norm


Project Name: Cadene/bootstrap.pytorch
Commit Name: 88a9140dce109b4739883107fcac88b246cf7355
Time: 2020-04-12
Author: remi.cadene@icloud.com
File Name: bootstrap/datasets/transforms.py
Class Name: CatTensors
Method Name: cat_tensors


Project Name: Cadene/bootstrap.pytorch
Commit Name: 88a9140dce109b4739883107fcac88b246cf7355
Time: 2020-04-12
Author: remi.cadene@icloud.com
File Name: bootstrap/datasets/transforms.py
Class Name: StackTensors
Method Name: stack_tensors