Revert to ANVTM in jni_lite due to Oculus failure.

Test Plan: FanW123 verified on her Oculus device

Reviewed By: FanW123

Differential Revision: D27943428

fbshipit-source-id: ac1c1ca6b47937f8839ba23c9e3af0843ea086a3
This commit is contained in:
Ailing Zhang
2021-04-22 11:43:18 -07:00
committed by Facebook GitHub Bot
parent 614dce54a6
commit 0c544ebd24

View File

@ -17,8 +17,14 @@ namespace pytorch_jni {
namespace {
struct LiteJITCallGuard {
// Inference only workload.
c10::InferenceMode guard;
// VariableType dispatch is not included in default mobile build. We need set
// this guard globally to avoid dispatch error (only for dynamic dispatch).
// Thanks to the unification of Variable class and Tensor class it's no longer
// required to toggle the NonVariableTypeMode per op - so it doesn't hurt to
// always set NonVariableTypeMode for inference only use case.
// TODO: avoid having to set this guard for custom mobile build with mobile
// interpreter.
torch::AutoNonVariableTypeMode non_var_guard;
};
} // namespace