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

Function PrintAllPythonOps

tensorflow/python/framework/python_op_gen_main.cc:108–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108void PrintAllPythonOps(const std::vector<string>& op_list,
109 const std::vector<string>& api_def_dirs,
110 const string& source_file_name, bool require_shapes,
111 bool op_list_is_whitelist) {
112 OpList ops;
113 OpRegistry::Global()->Export(false, &ops);
114
115 ApiDefMap api_def_map(ops);
116 if (!api_def_dirs.empty()) {
117 Env* env = Env::Default();
118
119 for (const auto& api_def_dir : api_def_dirs) {
120 std::vector<string> api_files;
121 TF_CHECK_OK(env->GetMatchingPaths(io::JoinPath(api_def_dir, "*.pbtxt"),
122 &api_files));
123 TF_CHECK_OK(api_def_map.LoadFileList(env, api_files));
124 }
125 api_def_map.UpdateDocs();
126 }
127
128 if (op_list_is_whitelist) {
129 std::unordered_set<string> whitelist(op_list.begin(), op_list.end());
130 OpList pruned_ops;
131 for (const auto& op_def : ops.op()) {
132 if (whitelist.find(op_def.name()) != whitelist.end()) {
133 *pruned_ops.mutable_op()->Add() = op_def;
134 }
135 }
136 PrintPythonOps(pruned_ops, api_def_map, {}, require_shapes,
137 source_file_name);
138 } else {
139 PrintPythonOps(ops, api_def_map, op_list, require_shapes, source_file_name);
140 }
141}
142
143} // namespace
144} // namespace tensorflow

Callers 1

mainFunction · 0.85

Calls 14

DefaultFunction · 0.85
PrintPythonOpsFunction · 0.85
ExportMethod · 0.80
LoadFileListMethod · 0.80
UpdateDocsMethod · 0.80
nameMethod · 0.65
JoinPathFunction · 0.50
emptyMethod · 0.45
GetMatchingPathsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
opMethod · 0.45

Tested by

no test coverage detected