Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
93df9a50
Unverified
Commit
93df9a50
authored
Jan 17, 2023
by
RoiEX
Committed by
GitHub
Jan 17, 2023
Browse files
Add missing type hints to ColorJitter constructor (#7087)
parent
8985b598
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
torchvision/transforms/transforms.py
torchvision/transforms/transforms.py
+8
-2
No files found.
torchvision/transforms/transforms.py
View file @
93df9a50
...
@@ -3,7 +3,7 @@ import numbers
...
@@ -3,7 +3,7 @@ import numbers
import
random
import
random
import
warnings
import
warnings
from
collections.abc
import
Sequence
from
collections.abc
import
Sequence
from
typing
import
List
,
Optional
,
Tuple
from
typing
import
List
,
Optional
,
Tuple
,
Union
import
torch
import
torch
from
torch
import
Tensor
from
torch
import
Tensor
...
@@ -1172,7 +1172,13 @@ class ColorJitter(torch.nn.Module):
...
@@ -1172,7 +1172,13 @@ class ColorJitter(torch.nn.Module):
or use an interpolation that generates negative values before using this function.
or use an interpolation that generates negative values before using this function.
"""
"""
def
__init__
(
self
,
brightness
=
0
,
contrast
=
0
,
saturation
=
0
,
hue
=
0
):
def
__init__
(
self
,
brightness
:
Union
[
float
,
Tuple
[
float
,
float
]]
=
0
,
contrast
:
Union
[
float
,
Tuple
[
float
,
float
]]
=
0
,
saturation
:
Union
[
float
,
Tuple
[
float
,
float
]]
=
0
,
hue
:
Union
[
float
,
Tuple
[
float
,
float
]]
=
0
,
)
->
None
:
super
().
__init__
()
super
().
__init__
()
_log_api_usage_once
(
self
)
_log_api_usage_once
(
self
)
self
.
brightness
=
self
.
_check_input
(
brightness
,
"brightness"
)
self
.
brightness
=
self
.
_check_input
(
brightness
,
"brightness"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment