How to use the torchgeometry.color function in torchgeometry

To help you get started, we’ve selected a few torchgeometry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kornia / kornia / test / test_color.py View on Github external
def test_gradcheck(self):
        batch_size, channels, height, width = 2, 3, 4, 5
        img = torch.ones(batch_size, channels, height, width)
        img = utils.tensor_to_gradcheck_var(img)  # to var
        assert gradcheck(color.rgb_to_grayscale, (img,), raise_exception=True)