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

Function StartFiles

tensorflow/cc/framework/cc_op_gen.cc:1020–1073  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1018}
1019
1020void StartFiles(bool internal, const string& dot_h_fname, WritableFile* h,
1021 WritableFile* cc, string* op_header_guard) {
1022 const string header =
1023 R"header(// This file is MACHINE GENERATED! Do not edit.
1024
1025#include "tensorflow/cc/framework/ops.h"
1026#include "tensorflow/cc/framework/scope.h"
1027#include "tensorflow/core/framework/tensor.h"
1028#include "tensorflow/core/framework/tensor_shape.h"
1029#include "tensorflow/core/framework/types.h"
1030#include "tensorflow/core/lib/gtl/array_slice.h"
1031)header";
1032
1033 // TODO(keveman): Make namespaces configurable.
1034 const string namespace_begin = internal ? R"namespace(
1035namespace tensorflow {
1036namespace ops {
1037namespace internal {
1038// NOTE: This namespace has internal TensorFlow details that
1039// are not part of TensorFlow's public API.
1040
1041)namespace"
1042 : R"namespace(
1043namespace tensorflow {
1044namespace ops {
1045
1046)namespace";
1047
1048 const string op_header = GetPath(dot_h_fname);
1049 *op_header_guard = ToGuard(op_header);
1050 const string cc_header = strings::StrCat(
1051 R"include(// This file is MACHINE GENERATED! Do not edit.
1052
1053
1054#include "tensorflow/cc/ops/const_op.h"
1055)include",
1056 "#include \"", op_header, "\"\n", namespace_begin);
1057
1058 const string filename = GetFilename(dot_h_fname);
1059 const string doxygen = strings::StrCat("/// @defgroup ", filename, " ",
1060 ToTitle(filename), "\n", "/// @{\n\n");
1061
1062 TF_CHECK_OK(h->Append(
1063 strings::StrCat("// This file is MACHINE GENERATED! Do not edit.\n\n"
1064 "#ifndef ",
1065 *op_header_guard,
1066 "\n"
1067 "#define ",
1068 *op_header_guard, "\n\n")));
1069 TF_CHECK_OK(h->Append(header));
1070 TF_CHECK_OK(h->Append(namespace_begin));
1071 TF_CHECK_OK(h->Append(doxygen));
1072 TF_CHECK_OK(cc->Append(cc_header));
1073}
1074
1075void FinishFiles(bool internal, WritableFile* h, WritableFile* cc,
1076 const string& op_header_guard) {

Callers 1

WriteCCOpsFunction · 0.85

Calls 6

GetPathFunction · 0.85
ToGuardFunction · 0.85
GetFilenameFunction · 0.85
ToTitleFunction · 0.85
StrCatFunction · 0.50
AppendMethod · 0.45

Tested by

no test coverage detected