You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the equalize transformation is not vectorized. It processes each channel of each image of the batch using a for loop. This is done because the method uses internally the torch.histc which currently can't produce a histogram across a dimension.
🚀 Feature
The current implementation of the equalize transformation is not vectorized. It processes each channel of each image of the batch using a for loop. This is done because the method uses internally the
torch.histc
which currently can't produce a histogram across a dimension.vision/torchvision/transforms/functional_tensor.py
Lines 1281 to 1282 in 83171d6
@fmassa proposed a workaround that trades memory for speed and achieves vectorization. Check #3123 (comment) for the overview/context of the proposal.
To adopt his, a few addtional changes need to be made:
_scale_channel()
needs to be adapted to vectorize the remaining operations._equalize_single_image()
needs to be removed and the stacking operation inequalize()
need to be adapted.cc @vfdev-5 @fmassa
The text was updated successfully, but these errors were encountered: