766bd71d6cca7313988b02784be6d56834e8c744,kornia/filters/kernels.py,,get_motion_kernel2d,#Any#Any#Any#,447

Before Change


    direction = (torch.clamp(direction, -1., 1.).item() + 1.) / 2.
    kernel = torch.zeros(kernel_tuple, dtype=torch.float)
    kernel[kernel_tuple[0] // 2, :] = torch.linspace(direction, 1. - direction, steps=kernel_tuple[0])
    kernel = kernel.unsqueeze(0).unsqueeze(0)
    // rotate (counterclockwise) kernel by given angle
    kernel = rotate(kernel, angle)
    kernel = kernel[0][0]
    kernel = kernel / kernel.sum()

After Change



    // Element-wise linspace
    kernel[:, kernel_tuple[0] // 2, :] = torch.stack(
        [(direction - (1 / (kernel_tuple[0] - 1)) * i) for i in range(kernel_tuple[0])], dim=-1)
    kernel = kernel.unsqueeze(1)
    // rotate (counterclockwise) kernel by given angle
    kernel = rotate(kernel, angle, mode="nearest", align_corners=True)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: arraiy/torchgeometry
Commit Name: 766bd71d6cca7313988b02784be6d56834e8c744
Time: 2020-10-19
Author: sj8716643@126.com
File Name: kornia/filters/kernels.py
Class Name:
Method Name: get_motion_kernel2d


Project Name: AIRLab-POLIMI/mushroom
Commit Name: ff55647673a7279b47d1268699839b92aca3e953
Time: 2021-02-10
Author: carlo.deramo@gmail.com
File Name: mushroom_rl/algorithms/value/dqn/rainbow.py
Class Name: RainbowNetwork
Method Name: forward


Project Name: cornellius-gp/gpytorch
Commit Name: cbfd111192d2b1ed7a43ebfac3178d31b844b4cd
Time: 2019-03-26
Author: gpleiss@gmail.com
File Name: gpytorch/utils/quadrature.py
Class Name: GaussHermiteQuadrature1D
Method Name: forward


Project Name: cornellius-gp/gpytorch
Commit Name: 0ec12f6fccb07305de1fd75527f5c156dab3c772
Time: 2020-12-16
Author: gpleiss@gmail.com
File Name: gpytorch/kernels/spectral_mixture_kernel.py
Class Name: SpectralMixtureKernel
Method Name: forward