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

Function SummarizeOpDef

tensorflow/core/framework/op_def_util.cc:389–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387} // namespace
388
389string SummarizeOpDef(const OpDef& op_def) {
390 string ret = strings::StrCat("Op<name=", op_def.name());
391 strings::StrAppend(&ret, "; signature=", SummarizeArgs(op_def.input_arg()),
392 " -> ", SummarizeArgs(op_def.output_arg()));
393 for (int i = 0; i < op_def.attr_size(); ++i) {
394 strings::StrAppend(&ret, "; attr=", op_def.attr(i).name(), ":",
395 op_def.attr(i).type());
396 if (op_def.attr(i).has_default_value()) {
397 strings::StrAppend(&ret, ",default=",
398 SummarizeAttrValue(op_def.attr(i).default_value()));
399 }
400 if (op_def.attr(i).has_minimum()) {
401 strings::StrAppend(&ret, ",min=", op_def.attr(i).minimum());
402 }
403 if (op_def.attr(i).has_allowed_values()) {
404 strings::StrAppend(&ret, ",allowed=",
405 SummarizeAttrValue(op_def.attr(i).allowed_values()));
406 }
407 }
408 if (op_def.is_commutative()) {
409 strings::StrAppend(&ret, "; is_commutative=true");
410 }
411 if (op_def.is_aggregate()) {
412 strings::StrAppend(&ret, "; is_aggregate=true");
413 }
414 if (op_def.is_stateful()) {
415 strings::StrAppend(&ret, "; is_stateful=true");
416 }
417 if (op_def.allows_uninitialized_input()) {
418 strings::StrAppend(&ret, "; allows_uninitialized_input=true");
419 }
420 strings::StrAppend(&ret, ">");
421 return ret;
422}
423
424namespace {
425

Callers 15

ValidateCompatibleMethod · 0.85
ExpectIncompatibleMethod · 0.85
LookUpSlowMethod · 0.85
DebugStringMethod · 0.85
FinalizeMethod · 0.85
MemoryTypesForNodeFunction · 0.85
ValidateNodeDefFunction · 0.85

Calls 11

SummarizeArgsFunction · 0.85
SummarizeAttrValueFunction · 0.85
attrMethod · 0.80
has_default_valueMethod · 0.80
minimumMethod · 0.80
nameMethod · 0.65
typeMethod · 0.65
StrCatFunction · 0.50
StrAppendFunction · 0.50
default_valueMethod · 0.45
is_statefulMethod · 0.45

Tested by 4

ExpectIncompatibleMethod · 0.68
ExpectSuccessFunction · 0.68
ExpectFailureFunction · 0.68