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
xuwx1
LightX2V
Commits
9d76391f
Unverified
Commit
9d76391f
authored
Dec 02, 2025
by
Yang Yong (雍洋)
Committed by
GitHub
Dec 02, 2025
Browse files
Add lightx2v_platform test case (#542)
parent
b50498fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
lightx2v_platform/test/test_device.py
lightx2v_platform/test/test_device.py
+9
-9
No files found.
lightx2v_platform/test/test_device.py
View file @
9d76391f
import
os
"""
PYTHONPATH=/path-to-LightX2V PLATFORM=cuda python test_device.py
PYTHONPATH=/path-to-LightX2V PLATFORM=mlu python test_device.py
PYTHONPATH=/path-to-LightX2V PLATFORM=metax python test_device.py
"""
from
lightx2v_platform
import
*
# This import will initialize the AI device
import
lightx2v_platform.set_ai_device
# noqa: F401
from
lightx2v_platform.base.global_var
import
AI_DEVICE
init_ai_device
(
os
.
getenv
(
"AI_DEVICE"
,
"cuda"
))
print
(
f
"AI_DEVICE:
{
AI_DEVICE
}
"
)
from
lightx2v_platform.base.global_var
import
AI_DEVICE
# noqa E402
if
__name__
==
"__main__"
:
print
(
f
"AI_DEVICE :
{
AI_DEVICE
}
"
)
is_available
=
check_ai_device
(
AI_DEVICE
)
print
(
f
"Device available:
{
is_available
}
"
)
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