kornia
kornia copied to clipboard
how do u set kornia?
self.set_rng_device_and_dtype(device="cuda", dtype=torch.float64) i didnt understand this part
what is self here ? and how do u set kornia to cuda ? so whatever i run it use gpu ?
@xalteropsx can you point to codebase / version ? or how are you attempting to use?
@xalteropsx i'll give a shot in the dark here, so, an example for your side will be welcomed
I know this is a method from the augmentation container, so if you are trying to setup an augmentation or a augmentation container you can follow this:
import torch
from kornia.augmentation import RandomJPEG
device = "cuda"
jpegq = (1.0, 50.0)
aug = RandomJPEG(jpeg_quality=jpegq, p=1.0)
aug.set_rng_device_and_dtype(device=torch.device(device), dtype=torch.float32)
example_input = torch.randn((3, 224, 224)).to(device)
res = aug(example_input)
where the self, refers to the augmentation or container instantiated class