Skip to content

Commit 8d61c2f

Browse files
committed
Fix errors caused by memory_format_tutorial
1 parent cca97f0 commit 8d61c2f

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

.circleci/scripts/build_for_windows.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,17 @@ python $DIR/remove_runnable_code.py beginner_source/aws_distributed_training_tut
4444
python $DIR/remove_runnable_code.py beginner_source/data_loading_tutorial.py beginner_source/data_loading_tutorial.py || true
4545
python $DIR/remove_runnable_code.py beginner_source/dcgan_faces_tutorial.py beginner_source/dcgan_faces_tutorial.py || true
4646
python $DIR/remove_runnable_code.py intermediate_source/model_parallel_tutorial.py intermediate_source/model_parallel_tutorial.py || true
47-
python $DIR/remove_runnable_code.py advanced_source/static_quantization_tutorial.py advanced_source/static_quantization_tutorial.py || true
48-
python $DIR/remove_runnable_code.py prototype_source/numeric_suite_tutorial.py || true
49-
python $DIR/remove_runnable_code.py prototype_source/graph_mode_static_quantization_tutorial.py || true
47+
48+
echo "keys = list(filter(lambda x: not x.startswith('_'), vars(torch.Tensor).keys()))" >> intermediate_source/memory_format_tutorial.py
49+
echo "for attr in keys:" >> intermediate_source/memory_format_tutorial.py
50+
echo " delattr(torch.Tensor, attr)" >> intermediate_source/memory_format_tutorial.py
51+
echo "keys = list(filter(lambda x: not x.startswith('_'), vars(torch.nn.functional).keys()))" >> intermediate_source/memory_format_tutorial.py
52+
echo "for attr in keys:" >> intermediate_source/memory_format_tutorial.py
53+
echo " delattr(torch.nn.functional, attr)" >> intermediate_source/memory_format_tutorial.py
54+
echo "keys = list(filter(lambda x: not x.startswith('_'), vars(torch).keys()))" >> intermediate_source/memory_format_tutorial.py
55+
echo "for attr in keys:" >> intermediate_source/memory_format_tutorial.py
56+
echo " delattr(torch, attr)" >> intermediate_source/memory_format_tutorial.py
57+
echo "from importlib import reload" >> intermediate_source/memory_format_tutorial.py
58+
echo "reload(torch)" >> intermediate_source/memory_format_tutorial.py
5059

5160
make docs

.circleci/scripts/test.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
set -eux -o pipefail
3+
4+
retry () {
5+
$* || (sleep 1 && $*) || (sleep 2 && $*)
6+
}
7+
8+
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
9+
PROJECT_DIR="${SOURCE_DIR}/../.."
10+
pushd ${PROJECT_DIR}
11+
12+
echo "keys = list(filter(lambda x: not x.startswith('_'), vars(torch.Tensor).keys()))" >> intermediate_source/memory_format_tutorial.py
13+
echo "for attr in keys:" >> intermediate_source/memory_format_tutorial.py
14+
echo " delattr(torch.Tensor, attr)" >> intermediate_source/memory_format_tutorial.py
15+
echo "keys = list(filter(lambda x: not x.startswith('_'), vars(torch.nn.functional).keys()))" >> intermediate_source/memory_format_tutorial.py
16+
echo "for attr in keys:" >> intermediate_source/memory_format_tutorial.py
17+
echo " delattr(torch.nn.functional, attr)" >> intermediate_source/memory_format_tutorial.py
18+
echo "keys = list(filter(lambda x: not x.startswith('_'), vars(torch).keys()))" >> intermediate_source/memory_format_tutorial.py
19+
echo "for attr in keys:" >> intermediate_source/memory_format_tutorial.py
20+
echo " delattr(torch, attr)" >> intermediate_source/memory_format_tutorial.py
21+
echo "from importlib import reload" >> intermediate_source/memory_format_tutorial.py
22+
echo "reload(torch)" >> intermediate_source/memory_format_tutorial.py
23+

0 commit comments

Comments
 (0)