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;