MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetEagerNotAllowedError

Method GetEagerNotAllowedError

tensorflow/python/framework/python_op_gen.cc:413–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413string GenEagerPythonOp::GetEagerNotAllowedError() {
414 bool eager_allowed = true;
415 string ref_arg;
416 for (int i = 0; i < op_def_.input_arg_size(); ++i) {
417 const auto& arg = op_def_.input_arg(i);
418 if (arg.is_ref()) {
419 eager_allowed = false;
420 DCHECK_EQ(op_def_.input_arg(i).name(), api_def_.in_arg(i).name());
421 ref_arg = api_def_.in_arg(i).rename_to();
422 }
423 }
424 for (int i = 0; i < op_def_.output_arg_size(); ++i) {
425 const auto& arg = op_def_.output_arg(i);
426 if (arg.is_ref()) {
427 eager_allowed = false;
428 DCHECK_EQ(op_def_.output_arg(i).name(), api_def_.out_arg(i).name());
429 ref_arg = api_def_.out_arg(i).rename_to();
430 }
431 }
432
433 if (eager_allowed) return "";
434
435 return strings::StrCat("raise RuntimeError(\"", op_name_,
436 " op does not support eager execution. ", "Arg '",
437 ref_arg, "' is a ref.\")\n");
438}
439
440void GenEagerPythonOp::ExpectListArg(const string& indentation,
441 const string& arg_name, string* output) {

Callers

nothing calls this directly

Calls 3

is_refMethod · 0.80
nameMethod · 0.65
StrCatFunction · 0.50

Tested by

no test coverage detected