Skip to content

Commit ecb9c6c

Browse files
authored
[ML] Silence warnings stemming from PyTorch headers (#2152)
On Windows a number of deprecation warnings are seen emanating from PyTorch header files (See #2120). An issue has been opened on the PyTorch repo requesting that these deprecations be addressed (pytorch/pytorch#69290). While the issue has been triaged it is suspected that it will be some time before fixes are forthcoming. These changes silence such deprecation warnings for pytorch_inference only.
1 parent 1cbb5bf commit ecb9c6c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bin/pytorch_inference/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ USE_NET=1
2222
USE_RAPIDJSON=1
2323
USE_TORCH=1
2424

25+
# These lines can be removed once PyTorch code is updated to avoid using features
26+
# that are deprecated in C++17 (and will be removed in C++20).
27+
# See https://github.com/pytorch/pytorch/issues/69290
28+
ifeq ($(OS),Windows)
29+
CPPFLAGS+=-D_HAS_FEATURES_REMOVED_IN_CXX20 -D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
30+
endif
31+
2532
LIBS=$(ML_LIBS)
2633

2734
all: build

0 commit comments

Comments
 (0)