mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2193fa119e
commit
307920731d
@ -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, @"");
|
||||
|
Reference in New Issue
Block a user