From 494dd31eca8c172df15512daafe05dcbe8253a80 Mon Sep 17 00:00:00 2001 From: Hakan Ardo Date: Thu, 23 Jan 2025 12:45:47 +0100 Subject: [PATCH] Run in default mode when inference mode is disabled --- src/libtorch.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libtorch.cc b/src/libtorch.cc index c4e964c..47a8399 100644 --- a/src/libtorch.cc +++ b/src/libtorch.cc @@ -1606,8 +1606,6 @@ ModelInstanceState::Execute( std::get<1>(model_state_->EnabledTensorExprFuser())); } - torch::NoGradGuard no_grad; - // If input is a dictionary, prepare dictionary from 'input_tensors'. if (is_dict_input_) { torch::Dict input_dict;