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

Method AddEagerAttrs

tensorflow/python/framework/python_op_gen.cc:892–911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

890}
891
892void GenEagerPythonOp::AddEagerAttrs(const string& indentation) {
893 // Compute eager attrs
894 if (op_def_.attr_size() > 0) {
895 string attr_values;
896 for (int i = 0; i < op_def_.attr_size(); ++i) {
897 if (i > 0) strings::StrAppend(&attr_values, ", ");
898 const auto& attr_name(op_def_.attr(i).name());
899 strings::StrAppend(&attr_values, "\"", attr_name, "\", ",
900 attr_expressions_[attr_name]);
901 }
902 strings::StrAppend(&attr_values, ")");
903 strings::StrAppend(
904 &result_,
905 WordWrap(indentation, strings::StrCat("_attrs = (", attr_values),
906 kRightMargin),
907 "\n");
908 } else {
909 strings::StrAppend(&result_, indentation, "_attrs = None\n");
910 }
911}
912
913void GenEagerPythonOp::AddEagerExecute(const string& indentation,
914 const string& num_outputs_expr) {

Callers

nothing calls this directly

Calls 3

WordWrapFunction · 0.85
StrAppendFunction · 0.50
StrCatFunction · 0.50

Tested by

no test coverage detected