bd21bb4fec8d10b257ceccc3d302abd6d5b7c7d5,kornia/filters/kernels.py,,get_motion_kernel2d,#Any#Any#Any#,447

Before Change


    if not isinstance(angle, float):
        raise TypeError("angle must be a float")

    if not isinstance(direction, float):
        raise TypeError("direction must be a float")

    kernel_tuple: Tuple[int, int] = (kernel_size, kernel_size)
    // direction from [-1, 1] to [0, 1] range
    direction = (torch.clamp(torch.tensor(direction), -1., 1.).item() + 1.) / 2.
    kernel = torch.zeros(kernel_tuple, dtype=torch.float)

After Change


    if not isinstance(angle, torch.Tensor):
        angle = torch.tensor(angle)

    assert angle.dim() == 0, f"angle must be a 0-dim tensor. Got {angle}."

    if not isinstance(direction, torch.Tensor):
        direction = torch.tensor(direction)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: arraiy/torchgeometry
Commit Name: bd21bb4fec8d10b257ceccc3d302abd6d5b7c7d5
Time: 2020-08-26
Author: sj8716643@126.com
File Name: kornia/filters/kernels.py
Class Name:
Method Name: get_motion_kernel2d


Project Name: r9y9/pysptk
Commit Name: 803b1d2422e36bfe051399467534433a4a7ba7fe
Time: 2018-10-28
Author: zryuichi@gmail.com
File Name: pysptk/synthesis.py
Class Name: Synthesizer
Method Name: __init__


Project Name: mortendahl/tf-encrypted
Commit Name: d70f1b18cfe69ca06d3462691e59177f628ae698
Time: 2019-08-01
Author: yann.dupis@gmail.com
File Name: tf_encrypted/keras/backend.py
Class Name:
Method Name: get_session