diff options
author | Tao Xu <taox@fb.com> | 2020-06-09 20:02:57 -0700 |
---|---|---|
committer | Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> | 2020-06-09 20:05:32 -0700 |
commit | 307920731d3d79dd394e54c2032d41b443353f9b (patch) | |
tree | 7493d4852c19b66edaa9d9298f4d649df37747c2 /ios | |
parent | 2193fa119ecf3539d586802b0a65a6faedbe1458 (diff) | |
download | pytorch-307920731d3d79dd394e54c2032d41b443353f9b.tar.gz pytorch-307920731d3d79dd394e54c2032d41b443353f9b.tar.bz2 pytorch-307920731d3d79dd394e54c2032d41b443353f9b.zip |
[iOS] Add nonVarTypeModeGuard to fix the unit test (#39743)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39743
### Summary
Still need this RAII guard for full JIT
### Test Plan
- CI checks
Test Plan: Imported from OSS
Differential Revision: D21968256
Pulled By: xta0
fbshipit-source-id: 8ea63c699fed4e2a01390232a58f039110391844
Diffstat (limited to 'ios')
-rw-r--r-- | ios/TestApp/TestAppTests/TestAppTests.mm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ios/TestApp/TestAppTests/TestAppTests.mm b/ios/TestApp/TestAppTests/TestAppTests.mm index 82ba9bc330..2505439b8a 100644 --- a/ios/TestApp/TestAppTests/TestAppTests.mm +++ b/ios/TestApp/TestAppTests/TestAppTests.mm @@ -28,6 +28,7 @@ std::vector<c10::IValue> inputs; inputs.push_back(torch::ones({1, 3, 224, 224}, at::ScalarType::Float)); torch::autograd::AutoGradMode guard(false); + at::AutoNonVariableTypeMode nonVarTypeModeGuard(true); auto outputTensor = _module.forward(inputs).toTensor(); float* outputBuffer = outputTensor.data_ptr<float>(); XCTAssertTrue(outputBuffer != nullptr, @""); |