Disable autograd fallback tests on Windows (#65147)
authorEdward Yang <ezyang@fb.com>
Fri, 17 Sep 2021 14:40:59 +0000 (07:40 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 17 Sep 2021 15:32:43 +0000 (08:32 -0700)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65147

I think they trigger an MSVC bug per https://github.com/pytorch/pytorch/issues/48763
ghstack-source-id: 138247203

Test Plan: breakpointed https://www.internalfb.com/intern/sandcastle/job/9007199738584981/ and sush'ed into the host and ran `buck build arvr/mode/win/opt //xplat/caffe2:autograd_libtorch_test_ovrsource` in `/cygdrive/d/ovrsource-null-hg`

Reviewed By: soulitzer

Differential Revision: D30992685

fbshipit-source-id: 06c6fb2c18d55490f89fc91ee5b7a4c5a7faf1c6

test/cpp/api/autograd.cpp

index edb73f9..8f80978 100644 (file)
@@ -969,6 +969,11 @@ void assertBasicChecks(F op) {
 
 } // namespace
 
+// These tests trigger an MSVC bug in the internal arvr build
+// Reproduce with: buck build @arvr/mode/win/opt //xplat/caffe2:autograd_libtorch_test_ovrsource
+// It is probably caused by the lambda, see https://github.com/pytorch/pytorch/issues/48763
+#if !defined(_MSC_VER)
+
 TEST(TestAutogradNotImplementedFallback, RetSingleNonTensor) {
   REGISTER_TEST_OP("ret_single_non_tensor", "_test::ret_single_non_tensor(Tensor self, Tensor other) -> int", ret_single_non_tensor);
   auto opHandle = c10::Dispatcher::singleton().findSchemaOrThrow("_test::ret_single_non_tensor", "");
@@ -1125,6 +1130,8 @@ TEST(TestAutogradNotImplementedFallback, TensorlistOp) {
   ASSERT_TRUE(at::allclose(op(a, vec), tensorlist_op(a, vec)));
 }
 
+#endif
+
 
 // TODO add these tests if needed
 // test_once_differentiable