1# Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# ============================================================================== 15"""Common utilities and settings used by tfdbg v2's op callbacks.""" 16 17from __future__ import absolute_import 18from __future__ import division 19from __future__ import print_function 20 21# The ops that are skipped by tfdbg v2's op callbacks. 22# They belong to TensorFlow's control flow ops (e.g., "Enter", "StatelessIf") 23# and ops that wrap nested tf.function calls. 24OP_CALLBACK_SKIP_OPS = ( 25 # TODO(b/139668453): The following skipped ops are related to a limitation 26 # in the op callback. 27 b"Enter", 28 b"Exit", 29 b"Identity", 30 b"If", 31 b"LoopCond", 32 b"Merge", 33 b"NextIteration", 34 b"StatelessIf", 35 b"StatefulPartitionedCall", 36 b"Switch", 37 b"While", 38 # NOTE(b/154097452): On TPUs, debugger ops are colocated with RemoteCall 39 # ops. This exclusion prevents an error due to no OpKernel for those 40 # debugger ops. 41 b"RemoteCall", 42 # TPU-specific ops begin. 43 b"TPUReplicatedInput", 44 b"TPUReplicateMetadata", 45 b"TPUCompilationResult", 46 b"TPUReplicatedOutput", 47 b"ConfigureDistributedTPU", 48 # Other special ops used by TensorFlow internally. 49 b"DestroyResourceOp", 50) 51