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

Method ShouldShow

tensorflow/core/profiler/internal/tfprof_show.cc:71–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71bool TFShow::ShouldShow(const ShowNode* node, const Options& opts,
72 int depth) const {
73 // Always show kTFProfRoot.
74 if (node->name() == kTFProfRoot) return true;
75
76 if (node->proto().total_requested_bytes() < opts.min_bytes ||
77 node->proto().total_peak_bytes() < opts.min_peak_bytes ||
78 node->proto().total_residual_bytes() < opts.min_residual_bytes ||
79 node->proto().total_output_bytes() < opts.min_output_bytes ||
80 node->proto().total_exec_micros() < opts.min_micros ||
81 node->proto().total_accelerator_exec_micros() <
82 opts.min_accelerator_micros ||
83 node->proto().total_cpu_exec_micros() < opts.min_cpu_micros ||
84 node->proto().parameters() < opts.min_params ||
85 node->proto().float_ops() < opts.min_float_ops ||
86 node->proto().run_count() < opts.min_occurrence ||
87 depth > opts.max_depth || !ShouldShowIfExtra(node, opts, depth)) {
88 return false;
89 }
90
91 bool show = false;
92 if (opts.show_name_regexes.size() == 1 && opts.show_name_regexes[0] == ".*") {
93 show = true;
94 } else {
95 for (const string& regex : opts.show_name_regexes) {
96 if (RE2::FullMatch(node->name(), regex)) {
97 show = true;
98 break;
99 }
100 }
101 }
102 // Don't show if show_name_regexes don't cover it.
103 if (!show) return false;
104 // Don't show if hide_name_regexes cover it.
105 for (const string& regex : opts.hide_name_regexes) {
106 if (RE2::FullMatch(node->name(), regex)) return false;
107 }
108 return true;
109}
110
111bool TFShow::ShouldTrim(const ShowNode* node,
112 const std::vector<string>& regexes) const {

Callers

nothing calls this directly

Calls 6

protoMethod · 0.80
nameMethod · 0.65
parametersMethod · 0.45
float_opsMethod · 0.45
run_countMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected