From b7b8d51250b555f73f7c587e5371dda359b5fb83 Mon Sep 17 00:00:00 2001 From: "chenbangduo.cbd" Date: Tue, 20 Feb 2024 09:46:29 +0800 Subject: [PATCH] [EV] Output error log if EV has been initialized when importing EV parameters. Signed-off-by: chenbangduo.cbd --- tensorflow/core/kernels/kv_variable_restore_ops.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tensorflow/core/kernels/kv_variable_restore_ops.cc b/tensorflow/core/kernels/kv_variable_restore_ops.cc index 3b10c2521b9..2eccf485ef8 100644 --- a/tensorflow/core/kernels/kv_variable_restore_ops.cc +++ b/tensorflow/core/kernels/kv_variable_restore_ops.cc @@ -373,6 +373,12 @@ class KvResourceImportV3Op: public AsyncOpKernel { core::ScopedUnref unref_me(ev); + // EV should not be initialized at this time. + if (ev->IsInitialized()) { + LOG(ERROR) << "Import parameter for EV (" << name_string + << ") failed, this EV has already been initialized."; + } + auto do_compute = [this, context, file_name_string, ev, name_string, done] () { BundleReader reader(Env::Default(), file_name_string);