I have a function which takes a numpy image array and performs some operations and returns a new image. During my forward pass, I want to use that function on the batch of tensors. What is the best way to achieve this?