7391aec984c1e9e0899d51e6b0538483c37ec8fb,torchdiffeq/_impl/adjoint.py,,odeint_adjoint,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,115

Before Change


        adjoint_options = options

    tensor_input = False
    if torch.is_tensor(y0):

        class TupleFunc(nn.Module):

            def __init__(self, base_func):
                super(TupleFunc, self).__init__()
                self.base_func = base_func

            def forward(self, t, y):
                return (self.base_func(t, y[0]),)

        tensor_input = True
        y0 = (y0,)
        func = TupleFunc(func)

    params = tuple(func.parameters())
    if adjoint_buffers:
        params = params + tuple(buffer for buffer in func.buffers() if buffer.requires_grad)
    n_tensors = len(y0)

After Change


    solution = OdeintAdjointMethod.apply(func, y0, t, rtol, atol, method, options, adjoint_rtol, adjoint_atol,
                                         adjoint_method, adjoint_options, t.requires_grad, *adjoint_params)

    if not tensor_input:
        solution = _flat_to_shape(solution, tuple([len(t), *shape] for shape in shapes))
    return solution
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 5

Instances


Project Name: rtqichen/torchdiffeq
Commit Name: 7391aec984c1e9e0899d51e6b0538483c37ec8fb
Time: 2020-07-27
Author: 33688385+patrick-kidger@users.noreply.github.com
File Name: torchdiffeq/_impl/adjoint.py
Class Name:
Method Name: odeint_adjoint


Project Name: cornellius-gp/gpytorch
Commit Name: 9c526695805c9639896b31364958d0e77bdeba62
Time: 2018-11-14
Author: gardner.jake@gmail.com
File Name: gpytorch/kernels/kernel.py
Class Name: Kernel
Method Name: __init__


Project Name: inferno-pytorch/inferno
Commit Name: 4a6ed2b3964a1a8e6679b1d864bfa84504a196ac
Time: 2017-07-07
Author: nasim.rahaman@iwr.uni-heidelberg.de
File Name: inferno/trainers/basic.py
Class Name: Trainer
Method Name: get_current_learning_rate


Project Name: cornellius-gp/gpytorch
Commit Name: d44475866914c19f23c0f8a833951f9989250334
Time: 2018-11-17
Author: balandat@fb.com
File Name: gpytorch/kernels/kernel.py
Class Name: Kernel
Method Name: __init__


Project Name: arraiy/torchgeometry
Commit Name: dac6839364405ff932bc33a5ca7845cba4f8b4ce
Time: 2019-10-07
Author: edgar.riba@gmail.com
File Name: kornia/color/adjust.py
Class Name:
Method Name: adjust_brightness