vision
vision copied to clipboard
RandomOrder transform now accepts torch.Tensor and works well with torch.seed
Changed the RandomOrder
transform to use torch.randperm
and thus make it Scriptable
:link: Helpful Links
:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/7773
- :page_facing_up: Preview Python docs built from this PR
Note: Links to docs will display an error until the docs builds have been completed.
This comment was automatically generated by Dr. CI and updates every 15 minutes.
This PR also lifts the restriction of RandomOrder
to take only PIL.Image
as input.
https://pytorch.org/vision/0.8/transforms.html#transforms-on-pil-image-only
JIT Scripting still doesn't work. Gives the following error RuntimeError: Expected integer literal for index, whilw JIT Scripting
It is due to https://github.com/pytorch/pytorch/issues/16123
But, other benefits of this PR:
- Removes restriction of inputs of RandomChoice of PIL.Image to also include torch.Tensors
- A step closer to make it JIT Scriptable
- Replaces the usage of the random module to native torch, thereby working well with torch seed