Build tfprof.OptionsProto. Args: options: A dictionary of options. Returns: tfprof.OptionsProto.
(options)
| 57 | |
| 58 | |
| 59 | def _build_options(options): |
| 60 | """Build tfprof.OptionsProto. |
| 61 | |
| 62 | Args: |
| 63 | options: A dictionary of options. |
| 64 | Returns: |
| 65 | tfprof.OptionsProto. |
| 66 | """ |
| 67 | opts = tfprof_options_pb2.OptionsProto() |
| 68 | opts.max_depth = options.get('max_depth', 10) |
| 69 | opts.min_bytes = options.get('min_bytes', 0) |
| 70 | opts.min_peak_bytes = options.get('min_peak_bytes', 0) |
| 71 | opts.min_residual_bytes = options.get('min_residual_bytes', 0) |
| 72 | opts.min_output_bytes = options.get('min_output_bytes', 0) |
| 73 | opts.min_micros = options.get('min_micros', 0) |
| 74 | opts.min_accelerator_micros = options.get('min_accelerator_micros', 0) |
| 75 | opts.min_cpu_micros = options.get('min_cpu_micros', 0) |
| 76 | opts.min_params = options.get('min_params', 0) |
| 77 | opts.min_float_ops = options.get('min_float_ops', 0) |
| 78 | opts.min_occurrence = options.get('min_occurrence', 0) |
| 79 | |
| 80 | opts.step = options.get('step', -1) |
| 81 | |
| 82 | opts.order_by = options.get('order_by', 'name') |
| 83 | |
| 84 | for p in options.get('account_type_regexes', []): |
| 85 | opts.account_type_regexes.append(p) |
| 86 | for p in options.get('start_name_regexes', []): |
| 87 | opts.start_name_regexes.append(p) |
| 88 | for p in options.get('trim_name_regexes', []): |
| 89 | opts.trim_name_regexes.append(p) |
| 90 | for p in options.get('show_name_regexes', []): |
| 91 | opts.show_name_regexes.append(p) |
| 92 | for p in options.get('hide_name_regexes', []): |
| 93 | opts.hide_name_regexes.append(p) |
| 94 | opts.account_displayed_op_only = options.get('account_displayed_op_only', |
| 95 | False) |
| 96 | |
| 97 | for p in options.get('select', []): |
| 98 | opts.select.append(p) |
| 99 | |
| 100 | opts.output = options.get('output', 'stdout') |
| 101 | opts.dump_to_file = options.get('dump_to_file', '') |
| 102 | |
| 103 | return opts |
| 104 | |
| 105 | |
| 106 | def _build_advisor_options(options): |
no test coverage detected