Commit bb88c45
adjust_hue now supports inputs of type Tensor (#2566)
* adjust_hue now supports inputs of type Tensor
* Added comparison between original adjust_hue and its Tensor and torch.jit.script versions.
* Added a few type checkings related to adjust_hue in functional_tensor.py in hopes to make F_t.adjust_hue scriptable...but to no avail.
* Changed implementation of _rgb2hsv and removed useless type declaration according to PR's review.
* Handled the range of hue_factor in the assertions and temporarily increased the assertLess bound to make sure that no other test fails.
* Fixed some lint issues with CircleCI and added type hints in functional_pil.py as well.
* Corrected type hint mistakes.
* Followed PR review recommendations and added test for class interface with hue.
* Refactored test_functional_tensor.py to match vfdev-5's d016cab branch by simple copy/paste and added the test_adjust_hue and ColorJitter class interface test in the same style (class interface test was removed in vfdev-5's branch for some reason).
* Removed test_adjustments from test_transforms_tensor.py and moved the ColorJitter class interface test in test_transforms_tensor.py.
* Added cuda test cases for test_adjustments and tried to fix conflict.
* Updated tests
- adjust hue
- color jitter
* Fixes incompatible devices
* Increased tol for cuda tests
* Fixes potential issue with inplace op
- fixes irreproducible failing test on Travis CI
* Reverted fmod -> %
Co-authored-by: vfdev-5 <[email protected]>1 parent ac3ba94 commit bb88c45
File tree
4 files changed
+41
-18
lines changed- test
- torchvision/transforms
4 files changed
+41
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | | - | |
223 | 222 | | |
224 | | - | |
225 | 223 | | |
226 | 224 | | |
227 | 225 | | |
| |||
230 | 228 | | |
231 | 229 | | |
232 | 230 | | |
233 | | - | |
234 | 231 | | |
235 | 232 | | |
236 | 233 | | |
| |||
245 | 242 | | |
246 | 243 | | |
247 | 244 | | |
248 | | - | |
249 | | - | |
250 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
276 | 286 | | |
277 | 287 | | |
278 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
81 | 93 | | |
82 | 94 | | |
83 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
736 | 736 | | |
737 | 737 | | |
738 | 738 | | |
739 | | - | |
| 739 | + | |
740 | 740 | | |
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
746 | 746 | | |
747 | | - | |
| 747 | + | |
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
| 752 | + | |
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
| 188 | + | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
| 197 | + | |
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
| |||
408 | 407 | | |
409 | 408 | | |
410 | 409 | | |
| 410 | + | |
| 411 | + | |
411 | 412 | | |
412 | 413 | | |
413 | 414 | | |
| |||
0 commit comments