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
754c954f
Unverified
Commit
754c954f
authored
Oct 07, 2020
by
vfdev
Committed by
GitHub
Oct 07, 2020
Browse files
Added scripted fn save test for random erase (#2767)
parent
5320f742
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
test/test_functional_tensor.py
test/test_functional_tensor.py
+0
-4
test/test_transforms_tensor.py
test/test_transforms_tensor.py
+3
-0
No files found.
test/test_functional_tensor.py
View file @
754c954f
...
@@ -741,10 +741,6 @@ class Tester(TransformsTester):
...
@@ -741,10 +741,6 @@ class Tester(TransformsTester):
batch_tensors
,
F
.
perspective
,
startpoints
=
spoints
,
endpoints
=
epoints
,
interpolation
=
0
batch_tensors
,
F
.
perspective
,
startpoints
=
spoints
,
endpoints
=
epoints
,
interpolation
=
0
)
)
def
test_convert_image_dtype
(
self
):
# TODO: add tests of CPU/CUDA on tensor and batch
pass
@
unittest
.
skipIf
(
not
torch
.
cuda
.
is_available
(),
reason
=
"Skip if no CUDA device"
)
@
unittest
.
skipIf
(
not
torch
.
cuda
.
is_available
(),
reason
=
"Skip if no CUDA device"
)
class
CUDATester
(
Tester
):
class
CUDATester
(
Tester
):
...
...
test/test_transforms_tensor.py
View file @
754c954f
...
@@ -490,6 +490,9 @@ class Tester(TransformsTester):
...
@@ -490,6 +490,9 @@ class Tester(TransformsTester):
self
.
_test_transform_vs_scripted
(
fn
,
scripted_fn
,
tensor
)
self
.
_test_transform_vs_scripted
(
fn
,
scripted_fn
,
tensor
)
self
.
_test_transform_vs_scripted_on_batch
(
fn
,
scripted_fn
,
batch_tensors
)
self
.
_test_transform_vs_scripted_on_batch
(
fn
,
scripted_fn
,
batch_tensors
)
with
get_tmp_dir
()
as
tmp_dir
:
scripted_fn
.
save
(
os
.
path
.
join
(
tmp_dir
,
"t_random_erasing.pt"
))
def
test_convert_image_dtype
(
self
):
def
test_convert_image_dtype
(
self
):
tensor
,
_
=
self
.
_create_data
(
26
,
34
,
device
=
self
.
device
)
tensor
,
_
=
self
.
_create_data
(
26
,
34
,
device
=
self
.
device
)
batch_tensors
=
torch
.
rand
(
4
,
3
,
44
,
56
,
device
=
self
.
device
)
batch_tensors
=
torch
.
rand
(
4
,
3
,
44
,
56
,
device
=
self
.
device
)
...
...
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