Skip to content

Commit

Permalink
refine_mock_torch (#10396)
Browse files Browse the repository at this point in the history
重构 mock_torch 模块
  • Loading branch information
ccssu authored Jan 9, 2024
1 parent af0807a commit d16fa88
Show file tree
Hide file tree
Showing 7 changed files with 1,008 additions and 392 deletions.
9 changes: 8 additions & 1 deletion ci/test/test_mock_script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/bash
set -e
python_version=$(python3 --version 2>&1 | awk '{print $2}')

if [[ "$python_version" < "3.8" ]]; then
echo "Python version is less than 3.8."
exit 0
fi

MOCK_TORCH=$PWD/python/oneflow/test/misc/mock_example.py

same_or_exit() {
Expand Down Expand Up @@ -56,4 +63,4 @@ python3 -c "import oneflow as flow; x = flow.load('test.pt'); assert flow.equal(
rm test.pt

eval $(python3 -m oneflow.mock_torch --lazy --verbose)
python3 -c "import torch.not_exist" | grep -q 'dummy object'
python3 -c "import torch.not_exist" | grep -q 'dummy object'
Loading

0 comments on commit d16fa88

Please sign in to comment.