73cb3ff00533b03ab64127d2287f9bdfe30c035c,kornia/losses/total_variation.py,,total_variation,#,33

Before Change


    if not torch.is_tensor(img):
        raise TypeError(f"Input type is not a torch.Tensor. Got {type(img)}")
    img_shape = img.shape
    if len(img_shape) == 3 or len(img_shape) == 4:
        pixel_dif1 = img[..., 1:, :] - img[..., :-1, :]
        pixel_dif2 = img[..., :, 1:] - img[..., :, :-1]
        reduce_axes = (-3, -2, -1)

After Change


    if not isinstance(img, torch.Tensor):
        raise TypeError(f"Input type is not a torch.Tensor. Got {type(img)}")

    if len(img.shape) < 3 or len(img.shape) > 4:
        raise ValueError(
            f"Expected input tensor to be of ndim 3 or 4, but got {len(img.shape)}."
        )

    pixel_dif1 = img[..., 1:, :] - img[..., :-1, :]
    pixel_dif2 = img[..., :, 1:] - img[..., :, :-1]

    reduce_axes = (-3, -2, -1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: arraiy/torchgeometry
Commit Name: 73cb3ff00533b03ab64127d2287f9bdfe30c035c
Time: 2021-01-16
Author: edgar.riba@gmail.com
File Name: kornia/losses/total_variation.py
Class Name:
Method Name: total_variation


Project Name: rasbt/mlxtend
Commit Name: bd3db7aeace61f2f37865dcc02a475966907cc87
Time: 2016-04-09
Author: mail@sebastianraschka.com
File Name: mlxtend/evaluate/decision_regions.py
Class Name:
Method Name: plot_decision_regions


Project Name: rasbt/mlxtend
Commit Name: c9e82bb1ab323d4a79793e47dbdd9204302e36af
Time: 2015-04-06
Author: se.raschka@me.com
File Name: mlxtend/file_io/find.py
Class Name:
Method Name: find_filegroups