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

Method GetConstructorDecl

tensorflow/cc/framework/cc_op_gen.cc:779–792  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777}
778
779string OpInfo::GetConstructorDecl(StringPiece op_name_prefix,
780 bool include_attr) const {
781 const string prefix = strings::StrCat(op_name_prefix, op_name, "(");
782 string c_decl;
783 for (int i = 0; i < arg_types.size(); ++i) {
784 if (i > 0) strings::StrAppend(&c_decl, ", ");
785 strings::StrAppend(&c_decl, arg_types[i], " ", arg_names[i]);
786 }
787 if (include_attr && has_optional_attrs) {
788 strings::StrAppend(&c_decl, ", const ", op_name, "::Attrs& attrs");
789 }
790 strings::StrAppend(&c_decl, ")");
791 return WordWrap(prefix, c_decl, kRightMargin);
792}
793
794void OpInfo::WriteClassDecl(WritableFile* h) const {
795 string class_decl = comment;

Callers

nothing calls this directly

Calls 4

WordWrapFunction · 0.85
StrCatFunction · 0.50
StrAppendFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected