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
81f0c0c9
Unverified
Commit
81f0c0c9
authored
Mar 03, 2023
by
Andrey Talman
Committed by
GitHub
Mar 03, 2023
Browse files
Execute compile smoke test only on linux, check that windows throws an exception (#7386)
parent
0e62c34f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
test/smoke_test.py
test/smoke_test.py
+12
-5
No files found.
test/smoke_test.py
View file @
81f0c0c9
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
os
import
os
from
pathlib
import
Path
from
pathlib
import
Path
from
sys
import
platform
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
...
@@ -29,11 +30,17 @@ def smoke_test_torchvision_read_decode() -> None:
...
@@ -29,11 +30,17 @@ def smoke_test_torchvision_read_decode() -> None:
def
smoke_test_compile
()
->
None
:
def
smoke_test_compile
()
->
None
:
try
:
model
=
resnet50
().
cuda
()
model
=
resnet50
().
cuda
()
model
=
torch
.
compile
(
model
)
model
=
torch
.
compile
(
model
)
x
=
torch
.
randn
(
1
,
3
,
224
,
224
,
device
=
"cuda"
)
x
=
torch
.
randn
(
1
,
3
,
224
,
224
,
device
=
"cuda"
)
out
=
model
(
x
)
out
=
model
(
x
)
print
(
f
"torch.compile model output:
{
out
.
shape
}
"
)
print
(
f
"torch.compile model output:
{
out
.
shape
}
"
)
except
RuntimeError
:
if
platform
==
"win32"
:
print
(
"Successfully caught torch.compile RuntimeError on win"
)
else
:
raise
def
smoke_test_torchvision_resnet50_classify
(
device
:
str
=
"cpu"
)
->
None
:
def
smoke_test_torchvision_resnet50_classify
(
device
:
str
=
"cpu"
)
->
None
:
...
...
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