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
ce441f6b
Unverified
Commit
ce441f6b
authored
Aug 30, 2023
by
Philip Meier
Committed by
GitHub
Aug 30, 2023
Browse files
remove trailing _tensor from image kernel checks (#7908)
parent
a2189d6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
test/test_transforms_v2_refactored.py
test/test_transforms_v2_refactored.py
+6
-6
No files found.
test/test_transforms_v2_refactored.py
View file @
ce441f6b
...
@@ -459,7 +459,7 @@ class TestResize:
...
@@ -459,7 +459,7 @@ class TestResize:
@
pytest
.
mark
.
parametrize
(
"antialias"
,
[
True
,
False
])
@
pytest
.
mark
.
parametrize
(
"antialias"
,
[
True
,
False
])
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
def
test_kernel_image
_tensor
(
self
,
size
,
interpolation
,
use_max_size
,
antialias
,
dtype
,
device
):
def
test_kernel_image
(
self
,
size
,
interpolation
,
use_max_size
,
antialias
,
dtype
,
device
):
if
not
(
max_size_kwarg
:
=
self
.
_make_max_size_kwarg
(
use_max_size
=
use_max_size
,
size
=
size
)):
if
not
(
max_size_kwarg
:
=
self
.
_make_max_size_kwarg
(
use_max_size
=
use_max_size
,
size
=
size
)):
return
return
...
@@ -830,7 +830,7 @@ class TestResize:
...
@@ -830,7 +830,7 @@ class TestResize:
class
TestHorizontalFlip
:
class
TestHorizontalFlip
:
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
def
test_kernel_image
_tensor
(
self
,
dtype
,
device
):
def
test_kernel_image
(
self
,
dtype
,
device
):
check_kernel
(
F
.
horizontal_flip_image
,
make_image
(
dtype
=
dtype
,
device
=
device
))
check_kernel
(
F
.
horizontal_flip_image
,
make_image
(
dtype
=
dtype
,
device
=
device
))
@
pytest
.
mark
.
parametrize
(
"format"
,
list
(
tv_tensors
.
BoundingBoxFormat
))
@
pytest
.
mark
.
parametrize
(
"format"
,
list
(
tv_tensors
.
BoundingBoxFormat
))
...
@@ -980,7 +980,7 @@ class TestAffine:
...
@@ -980,7 +980,7 @@ class TestAffine:
)
)
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
def
test_kernel_image
_tensor
(
self
,
param
,
value
,
dtype
,
device
):
def
test_kernel_image
(
self
,
param
,
value
,
dtype
,
device
):
if
param
==
"fill"
:
if
param
==
"fill"
:
value
=
adapt_fill
(
value
,
dtype
=
dtype
)
value
=
adapt_fill
(
value
,
dtype
=
dtype
)
self
.
_check_kernel
(
self
.
_check_kernel
(
...
@@ -1280,7 +1280,7 @@ class TestAffine:
...
@@ -1280,7 +1280,7 @@ class TestAffine:
class
TestVerticalFlip
:
class
TestVerticalFlip
:
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
def
test_kernel_image
_tensor
(
self
,
dtype
,
device
):
def
test_kernel_image
(
self
,
dtype
,
device
):
check_kernel
(
F
.
vertical_flip_image
,
make_image
(
dtype
=
dtype
,
device
=
device
))
check_kernel
(
F
.
vertical_flip_image
,
make_image
(
dtype
=
dtype
,
device
=
device
))
@
pytest
.
mark
.
parametrize
(
"format"
,
list
(
tv_tensors
.
BoundingBoxFormat
))
@
pytest
.
mark
.
parametrize
(
"format"
,
list
(
tv_tensors
.
BoundingBoxFormat
))
...
@@ -1404,7 +1404,7 @@ class TestRotate:
...
@@ -1404,7 +1404,7 @@ class TestRotate:
)
)
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
def
test_kernel_image
_tensor
(
self
,
param
,
value
,
dtype
,
device
):
def
test_kernel_image
(
self
,
param
,
value
,
dtype
,
device
):
kwargs
=
{
param
:
value
}
kwargs
=
{
param
:
value
}
if
param
!=
"angle"
:
if
param
!=
"angle"
:
kwargs
[
"angle"
]
=
self
.
_MINIMAL_AFFINE_KWARGS
[
"angle"
]
kwargs
[
"angle"
]
=
self
.
_MINIMAL_AFFINE_KWARGS
[
"angle"
]
...
@@ -2382,7 +2382,7 @@ class TestElastic:
...
@@ -2382,7 +2382,7 @@ class TestElastic:
)
)
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"dtype"
,
[
torch
.
float32
,
torch
.
uint8
])
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_cuda
())
def
test_kernel_image
_tensor
(
self
,
param
,
value
,
dtype
,
device
):
def
test_kernel_image
(
self
,
param
,
value
,
dtype
,
device
):
image
=
make_image_tensor
(
dtype
=
dtype
,
device
=
device
)
image
=
make_image_tensor
(
dtype
=
dtype
,
device
=
device
)
check_kernel
(
check_kernel
(
...
...
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