I am wondering if there is a way to have custom transformer do transformation in batch instead of per image.
Currently, I am writing custom code in do_transform(self, x, is_y): method.
I am wondering if there is a way to have custom transformer do transformation in batch instead of per image.
Currently, I am writing custom code in do_transform(self, x, is_y): method.
It is completely possible. You should pass it to the DeviceDataLoader
by using the method add_tfm
(and then remove_tfm
when you’re done). It should take a batch b
as an argument (then x = b[0] and y = b[1]).
Oh but by looking at your is_y
argument you may be in v0.7 still. What I’m talking about is only possible in v1.