Potential fix for model inference crash on Win10 (#15919) (#16092)
authorDavidWongEA <46357167+davidwongea@users.noreply.github.com>
Thu, 17 Jan 2019 16:30:55 +0000 (08:30 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 17 Jan 2019 16:44:02 +0000 (08:44 -0800)
Summary:
Please refer to issue #15919
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16092

Differential Revision: D13712897

Pulled By: soumith

fbshipit-source-id: edcd1ed3504f1fa1af841a1757616382c745958f

torch/csrc/jit/stack.h

index e445691..8ff3d35 100644 (file)
@@ -65,9 +65,7 @@ static inline void pop(Stack& stack, Types&... args) {
 }
 template <typename... Types>
 static inline void push(Stack& stack, Types&&... args) {
-  constexpr size_t N = sizeof...(args);
-  int result[N] = {(stack.emplace_back(std::forward<Types>(args)), 0)...};
-  (void)result;
+       std::initializer_list<int>{(stack.emplace_back(std::forward<Types>(args)), 0)...};
 }
 
 // The packer here is carefully written not to make any unnecessary