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

Method _skip_op

tensorflow/python/tpu/tensor_tracer.py:765–809  ·  view source on GitHub ↗

Returns True if we should not trace Op. Args: op_id: Topological index of the op. op: tf.Operation ops_in_exec_path: Set of operations that are in the execution path. report_handler: An instance of tensor_tracer_report.TTReportHandle. Returns: True if the op sh

(self, op_id, op, ops_in_exec_path, report_handler)

Source from the content-addressed store, hash-verified

763 %self._parameters.trace_mode)
764
765 def _skip_op(self, op_id, op, ops_in_exec_path, report_handler):
766 """Returns True if we should not trace Op.
767
768 Args:
769 op_id: Topological index of the op.
770 op: tf.Operation
771 ops_in_exec_path: Set of operations that are in the execution path.
772 report_handler: An instance of tensor_tracer_report.TTReportHandle.
773 Returns:
774 True if the op should not be traced, false otherwise.
775 """
776 if TensorTracer.while_loop_op(op):
777 report_handler.instrument_op(
778 op, TensorTracer.reason(op_id, _REASON_WHILELOOP_OP))
779 return True
780 if TensorTracer.unsafe_op(op):
781 report_handler.instrument_op(
782 op, TensorTracer.reason(op_id, _REASON_UNSAFE_OP))
783 return True
784 if TensorTracer.device_mismatch(self._tt_config.device_type, op):
785 report_handler.instrument_op(
786 op, TensorTracer.reason(op_id, _REASON_DEVICE_MISMATCH))
787 return True
788 if op not in ops_in_exec_path:
789 report_handler.instrument_op(
790 op, TensorTracer.reason(op_id, _REASON_NOT_EXECUTED))
791 return True
792
793 if not self._inside_op_range(op_id):
794 report_handler.instrument_op(
795 op, TensorTracer.reason(op_id, _REASON_OUTSIDE_OP_RANGE))
796 return True
797 if self._less_interesting_op(op):
798 report_handler.instrument_op(
799 op, TensorTracer.reason(op_id, _REASON_LESS_INTERESTING_OP))
800 return True
801 if self._is_user_included_op(op):
802 report_handler.instrument_op(
803 op, TensorTracer.reason(op_id, _REASON_USER_INCLUDED))
804 return False
805 if self._is_user_excluded_op(op):
806 report_handler.instrument_op(
807 op, TensorTracer.reason(op_id, _REASON_USER_EXCLUDED))
808 return True
809 return False
810
811 def _skip_tensor(self, op_id, out_tensor, report_handler):
812 """Returns True if we should not trace out_tensor.

Calls 9

_inside_op_rangeMethod · 0.95
_less_interesting_opMethod · 0.95
_is_user_included_opMethod · 0.95
_is_user_excluded_opMethod · 0.95
while_loop_opMethod · 0.80
instrument_opMethod · 0.80
reasonMethod · 0.80
unsafe_opMethod · 0.80
device_mismatchMethod · 0.80

Tested by

no test coverage detected