Mentions légales du service

Skip to content
Snippets Groups Projects
Verified Commit fdb8167f authored by ANDREY Paul's avatar ANDREY Paul
Browse files

Have some unit tests re-run using Torch-1.13 in the CI.

parent 7468f705
No related branches found
No related tags found
1 merge request!49Add support for Torch 2.0
...@@ -114,6 +114,7 @@ run_declearn_tests() { ...@@ -114,6 +114,7 @@ run_declearn_tests() {
commands=( commands=(
"run_unit_tests $@" "run_unit_tests $@"
"run_integration_tests $@" "run_integration_tests $@"
"run_torch13_tests $@"
) )
run_commands "declearn test suite" "${commands[@]}" run_commands "declearn test suite" "${commands[@]}"
status=$? status=$?
...@@ -152,6 +153,33 @@ run_integration_tests() { ...@@ -152,6 +153,33 @@ run_integration_tests() {
} }
run_torch13_tests() {
: '
Verbosely run Torch 1.13-specific unit tests.
Install Torch 1.13 at the start of this function, and re-install
torch >=2.0 at the end of it, together with its co-dependencies.
'
echo "Re-installing torch 1.13 and its co-dependencies."
pip install .[torch1]
if [[ $? -eq 0 ]]; then
echo "Running unit tests for torch 1.13."
command="pytest $@
--cov --cov-append --cov-report=
test/model/test_torch.py
"
run_command $command
status=$?
else
echo "\e[31mSkipping tests as installation failed.\e[0m"
status=1
fi
echo "Re-installing torch 2.X and its co-dependencies."
pip install .[torch2]
return $status
}
main() { main() {
if [[ $# -eq 0 ]]; then if [[ $# -eq 0 ]]; then
echo "Missing required positional argument." echo "Missing required positional argument."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment