xref: /aosp_15_r20/external/tensorflow/tensorflow/python/autograph/core/config.py (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1# Copyright 2016 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"""Global configuration."""
16
17from tensorflow.python.autograph.core import config_lib
18
19Action = config_lib.Action
20Convert = config_lib.Convert
21DoNotConvert = config_lib.DoNotConvert
22
23
24# This list is evaluated in order and stops at the first rule that tests True
25# for a definitely_convert of definitely_bypass call.
26CONVERSION_RULES = (
27    # Known packages
28    Convert('tensorflow.python.training.experimental'),
29
30    # Builtin modules
31    DoNotConvert('collections'),
32    DoNotConvert('copy'),
33    DoNotConvert('cProfile'),
34    DoNotConvert('inspect'),
35    DoNotConvert('ipdb'),
36    DoNotConvert('linecache'),
37    DoNotConvert('mock'),
38    DoNotConvert('pathlib'),
39    DoNotConvert('pdb'),
40    DoNotConvert('posixpath'),
41    DoNotConvert('pstats'),
42    DoNotConvert('re'),
43    DoNotConvert('threading'),
44    DoNotConvert('urllib'),
45
46    # Known libraries
47    DoNotConvert('matplotlib'),
48    DoNotConvert('numpy'),
49    DoNotConvert('pandas'),
50    DoNotConvert('tensorflow'),
51    DoNotConvert('PIL'),
52    DoNotConvert('absl.logging'),
53
54    # TODO(b/133417201): Remove.
55    DoNotConvert('tensorflow_probability'),
56
57    # TODO(b/133842282): Remove.
58    DoNotConvert('tensorflow_datasets.core'),
59
60    DoNotConvert('keras'),
61)
62