A couple of small changes to model_clay.py after initial implementation at #47.
[x] Handle layers across cpu/gpu devices a bit better, to prevent errors like RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
[x] Let the masking in the Masked Autoencoder be dynamic, so that setting self.model.encoder.mask_ratio = 0 would disable the masking.
First one is cherry-picked from @srmsoumya's ddp branch. Second one will be helpful for the embedding generation later on.
Ok, gonna merge this patch in directly since others may benefit from the improve cuda/cpu device handling. Plus I'll need these patches for the embedding factory script.
A couple of small changes to
model_clay.py
after initial implementation at #47.RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
self.model.encoder.mask_ratio = 0
would disable the masking.First one is cherry-picked from @srmsoumya's
ddp
branch. Second one will be helpful for the embedding generation later on.