1# Copyright 2018 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# pylint: disable=line-too-long 16"""List of renames to apply when converting from TF 1.0 to TF 2.0. 17 18THIS FILE IS AUTOGENERATED: To update, please run: 19 bazel build tensorflow/tools/compatibility/update:generate_v2_reorders_map 20 bazel-bin/tensorflow/tools/compatibility/update/generate_v2_reorders_map 21This file should be updated whenever a function is added to 22self.reordered_function_names in tf_upgrade_v2.py. 23""" 24from __future__ import absolute_import 25from __future__ import division 26from __future__ import print_function 27 28reorders = { 29 'tf.argmax': ['input', 'axis', 'name', 'dimension', 'output_type'], 30 'tf.argmin': ['input', 'axis', 'name', 'dimension', 'output_type'], 31 'tf.batch_to_space': ['input', 'crops', 'block_size', 'name', 'block_shape'], 32 'tf.boolean_mask': ['tensor', 'mask', 'name', 'axis'], 33 'tf.cond': ['pred', 'true_fn', 'false_fn', 'strict', 'name', 'fn1', 'fn2'], 34 'tf.confusion_matrix': ['labels', 'predictions', 'num_classes', 'dtype', 'name', 'weights'], 35 'tf.convert_to_tensor': ['value', 'dtype', 'name', 'preferred_dtype', 'dtype_hint'], 36 'tf.data.experimental.RaggedTensorStructure': ['dtype', 'shape', 'ragged_rank'], 37 'tf.data.experimental.SparseTensorStructure': ['dtype', 'shape'], 38 'tf.data.experimental.TensorArrayStructure': ['dtype', 'element_shape', 'dynamic_size', 'infer_shape'], 39 'tf.data.experimental.TensorStructure': ['dtype', 'shape'], 40 'tf.decode_csv': ['records', 'record_defaults', 'field_delim', 'use_quote_delim', 'name', 'na_value', 'select_cols'], 41 'tf.depth_to_space': ['input', 'block_size', 'name', 'data_format'], 42 'tf.estimator.BaselineClassifier': ['model_dir', 'n_classes', 'weight_column', 'label_vocabulary', 'optimizer', 'config', 'loss_reduction'], 43 'tf.estimator.BaselineRegressor': ['model_dir', 'label_dimension', 'weight_column', 'optimizer', 'config', 'loss_reduction'], 44 'tf.estimator.DNNClassifier': ['hidden_units', 'feature_columns', 'model_dir', 'n_classes', 'weight_column', 'label_vocabulary', 'optimizer', 'activation_fn', 'dropout', 'input_layer_partitioner', 'config', 'warm_start_from', 'loss_reduction', 'batch_norm'], 45 'tf.estimator.DNNLinearCombinedClassifier': ['model_dir', 'linear_feature_columns', 'linear_optimizer', 'dnn_feature_columns', 'dnn_optimizer', 'dnn_hidden_units', 'dnn_activation_fn', 'dnn_dropout', 'n_classes', 'weight_column', 'label_vocabulary', 'input_layer_partitioner', 'config', 'warm_start_from', 'loss_reduction', 'batch_norm', 'linear_sparse_combiner'], 46 'tf.estimator.DNNLinearCombinedRegressor': ['model_dir', 'linear_feature_columns', 'linear_optimizer', 'dnn_feature_columns', 'dnn_optimizer', 'dnn_hidden_units', 'dnn_activation_fn', 'dnn_dropout', 'label_dimension', 'weight_column', 'input_layer_partitioner', 'config', 'warm_start_from', 'loss_reduction', 'batch_norm', 'linear_sparse_combiner'], 47 'tf.estimator.DNNRegressor': ['hidden_units', 'feature_columns', 'model_dir', 'label_dimension', 'weight_column', 'optimizer', 'activation_fn', 'dropout', 'input_layer_partitioner', 'config', 'warm_start_from', 'loss_reduction', 'batch_norm'], 48 'tf.estimator.LinearClassifier': ['feature_columns', 'model_dir', 'n_classes', 'weight_column', 'label_vocabulary', 'optimizer', 'config', 'partitioner', 'warm_start_from', 'loss_reduction', 'sparse_combiner'], 49 'tf.estimator.LinearRegressor': ['feature_columns', 'model_dir', 'label_dimension', 'weight_column', 'optimizer', 'config', 'partitioner', 'warm_start_from', 'loss_reduction', 'sparse_combiner'], 50 'tf.feature_column.categorical_column_with_vocabulary_file': ['key', 'vocabulary_file', 'vocabulary_size', 'num_oov_buckets', 'default_value', 'dtype'], 51 'tf.gradients': ['ys', 'xs', 'grad_ys', 'name', 'colocate_gradients_with_ops', 'gate_gradients', 'aggregation_method', 'stop_gradients', 'unconnected_gradients'], 52 'tf.hessians': ['ys', 'xs', 'name', 'colocate_gradients_with_ops', 'gate_gradients', 'aggregation_method'], 53 'tf.image.sample_distorted_bounding_box': ['image_size', 'bounding_boxes', 'seed', 'seed2', 'min_object_covered', 'aspect_ratio_range', 'area_range', 'max_attempts', 'use_image_if_no_bounding_boxes', 'name'], 54 'tf.initializers.uniform_unit_scaling': ['factor', 'seed', 'dtype'], 55 'tf.io.decode_csv': ['records', 'record_defaults', 'field_delim', 'use_quote_delim', 'name', 'na_value', 'select_cols'], 56 'tf.io.parse_example': ['serialized', 'features', 'name', 'example_names'], 57 'tf.io.parse_single_example': ['serialized', 'features', 'name', 'example_names'], 58 'tf.io.serialize_many_sparse': ['sp_input', 'name', 'out_type'], 59 'tf.io.serialize_sparse': ['sp_input', 'name', 'out_type'], 60 'tf.linalg.norm': ['tensor', 'ord', 'axis', 'keepdims', 'name', 'keep_dims'], 61 'tf.math.argmax': ['input', 'axis', 'name', 'dimension', 'output_type'], 62 'tf.math.argmin': ['input', 'axis', 'name', 'dimension', 'output_type'], 63 'tf.math.confusion_matrix': ['labels', 'predictions', 'num_classes', 'dtype', 'name', 'weights'], 64 'tf.math.in_top_k': ['predictions', 'targets', 'k', 'name'], 65 'tf.math.reduce_all': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 66 'tf.math.reduce_any': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 67 'tf.math.reduce_logsumexp': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 68 'tf.math.reduce_max': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 69 'tf.math.reduce_mean': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 70 'tf.math.reduce_min': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 71 'tf.math.reduce_prod': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 72 'tf.math.reduce_sum': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 73 'tf.multinomial': ['logits', 'num_samples', 'seed', 'name', 'output_dtype'], 74 'tf.nn.avg_pool': ['value', 'ksize', 'strides', 'padding', 'data_format', 'name', 'input'], 75 'tf.nn.avg_pool2d': ['value', 'ksize', 'strides', 'padding', 'data_format', 'name', 'input'], 76 'tf.nn.conv1d': ['value', 'filters', 'stride', 'padding', 'use_cudnn_on_gpu', 'data_format', 'name', 'input', 'dilations'], 77 'tf.nn.conv2d': ['input', 'filter', 'strides', 'padding', 'use_cudnn_on_gpu', 'data_format', 'dilations', 'name', 'filters'], 78 'tf.nn.conv2d_backprop_input': ['input_sizes', 'filter', 'out_backprop', 'strides', 'padding', 'use_cudnn_on_gpu', 'data_format', 'dilations', 'name', 'filters'], 79 'tf.nn.convolution': ['input', 'filter', 'padding', 'strides', 'dilation_rate', 'name', 'data_format', 'filters', 'dilations'], 80 'tf.nn.crelu': ['features', 'name', 'axis'], 81 'tf.nn.ctc_beam_search_decoder': ['inputs', 'sequence_length', 'beam_width', 'top_paths', 'merge_repeated'], 82 'tf.nn.depth_to_space': ['input', 'block_size', 'name', 'data_format'], 83 'tf.nn.depthwise_conv2d': ['input', 'filter', 'strides', 'padding', 'rate', 'name', 'data_format', 'dilations'], 84 'tf.nn.embedding_lookup': ['params', 'ids', 'partition_strategy', 'name', 'validate_indices', 'max_norm'], 85 'tf.nn.embedding_lookup_sparse': ['params', 'sp_ids', 'sp_weights', 'partition_strategy', 'name', 'combiner', 'max_norm'], 86 'tf.nn.fractional_avg_pool': ['value', 'pooling_ratio', 'pseudo_random', 'overlapping', 'deterministic', 'seed', 'seed2', 'name'], 87 'tf.nn.fractional_max_pool': ['value', 'pooling_ratio', 'pseudo_random', 'overlapping', 'deterministic', 'seed', 'seed2', 'name'], 88 'tf.nn.in_top_k': ['predictions', 'targets', 'k', 'name'], 89 'tf.nn.max_pool': ['value', 'ksize', 'strides', 'padding', 'data_format', 'name', 'input'], 90 'tf.nn.moments': ['x', 'axes', 'shift', 'name', 'keep_dims', 'keepdims'], 91 'tf.nn.pool': ['input', 'window_shape', 'pooling_type', 'padding', 'dilation_rate', 'strides', 'name', 'data_format', 'dilations'], 92 'tf.nn.separable_conv2d': ['input', 'depthwise_filter', 'pointwise_filter', 'strides', 'padding', 'rate', 'name', 'data_format', 'dilations'], 93 'tf.nn.softmax_cross_entropy_with_logits': ['_sentinel', 'labels', 'logits', 'dim', 'name', 'axis'], 94 'tf.nn.space_to_batch': ['input', 'paddings', 'block_size', 'name', 'block_shape'], 95 'tf.nn.space_to_depth': ['input', 'block_size', 'name', 'data_format'], 96 'tf.nn.weighted_moments': ['x', 'axes', 'frequency_weights', 'name', 'keep_dims', 'keepdims'], 97 'tf.norm': ['tensor', 'ord', 'axis', 'keepdims', 'name', 'keep_dims'], 98 'tf.pad': ['tensor', 'paddings', 'mode', 'name', 'constant_values'], 99 'tf.parse_example': ['serialized', 'features', 'name', 'example_names'], 100 'tf.parse_single_example': ['serialized', 'features', 'name', 'example_names'], 101 'tf.quantize_v2': ['input', 'min_range', 'max_range', 'T', 'mode', 'name', 'round_mode', 'narrow_range', 'axis', 'ensure_minimum_range'], 102 'tf.random.multinomial': ['logits', 'num_samples', 'seed', 'name', 'output_dtype'], 103 'tf.random.poisson': ['lam', 'shape', 'dtype', 'seed', 'name'], 104 'tf.random_poisson': ['lam', 'shape', 'dtype', 'seed', 'name'], 105 'tf.reduce_all': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 106 'tf.reduce_any': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 107 'tf.reduce_join': ['inputs', 'axis', 'keep_dims', 'separator', 'name', 'reduction_indices', 'keepdims'], 108 'tf.reduce_logsumexp': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 109 'tf.reduce_max': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 110 'tf.reduce_mean': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 111 'tf.reduce_min': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 112 'tf.reduce_prod': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 113 'tf.reduce_sum': ['input_tensor', 'axis', 'keepdims', 'name', 'reduction_indices', 'keep_dims'], 114 'tf.reverse_sequence': ['input', 'seq_lengths', 'seq_axis', 'batch_axis', 'name', 'seq_dim', 'batch_dim'], 115 'tf.serialize_many_sparse': ['sp_input', 'name', 'out_type'], 116 'tf.serialize_sparse': ['sp_input', 'name', 'out_type'], 117 'tf.shape': ['input', 'name', 'out_type'], 118 'tf.size': ['input', 'name', 'out_type'], 119 'tf.space_to_batch': ['input', 'paddings', 'block_size', 'name', 'block_shape'], 120 'tf.space_to_depth': ['input', 'block_size', 'name', 'data_format'], 121 'tf.sparse.add': ['a', 'b', 'threshold', 'thresh'], 122 'tf.sparse.concat': ['axis', 'sp_inputs', 'name', 'expand_nonconcat_dim', 'concat_dim', 'expand_nonconcat_dims'], 123 'tf.sparse.reduce_max': ['sp_input', 'axis', 'keepdims', 'reduction_axes', 'keep_dims'], 124 'tf.sparse.segment_mean': ['data', 'indices', 'segment_ids', 'name', 'num_segments'], 125 'tf.sparse.segment_sqrt_n': ['data', 'indices', 'segment_ids', 'name', 'num_segments'], 126 'tf.sparse.segment_sum': ['data', 'indices', 'segment_ids', 'name', 'num_segments'], 127 'tf.sparse.split': ['keyword_required', 'sp_input', 'num_split', 'axis', 'name', 'split_dim'], 128 'tf.sparse_add': ['a', 'b', 'threshold', 'thresh'], 129 'tf.sparse_concat': ['axis', 'sp_inputs', 'name', 'expand_nonconcat_dim', 'concat_dim', 'expand_nonconcat_dims'], 130 'tf.sparse_matmul': ['a', 'b', 'transpose_a', 'transpose_b', 'a_is_sparse', 'b_is_sparse', 'name'], 131 'tf.sparse_reduce_max': ['sp_input', 'axis', 'keepdims', 'reduction_axes', 'keep_dims'], 132 'tf.sparse_segment_mean': ['data', 'indices', 'segment_ids', 'name', 'num_segments'], 133 'tf.sparse_segment_sqrt_n': ['data', 'indices', 'segment_ids', 'name', 'num_segments'], 134 'tf.sparse_segment_sum': ['data', 'indices', 'segment_ids', 'name', 'num_segments'], 135 'tf.sparse_split': ['keyword_required', 'sp_input', 'num_split', 'axis', 'name', 'split_dim'], 136 'tf.strings.length': ['input', 'name', 'unit'], 137 'tf.strings.reduce_join': ['inputs', 'axis', 'keep_dims', 'separator', 'name', 'reduction_indices', 'keepdims'], 138 'tf.strings.substr': ['input', 'pos', 'len', 'name', 'unit'], 139 'tf.substr': ['input', 'pos', 'len', 'name', 'unit'], 140 'tf.test.assert_equal_graph_def': ['actual', 'expected', 'checkpoint_v2', 'hash_table_shared_name'], 141 'tf.train.sdca_fprint': ['input', 'name'], 142 'tf.train.sdca_optimizer': ['sparse_example_indices', 'sparse_feature_indices', 'sparse_feature_values', 'dense_features', 'example_weights', 'example_labels', 'sparse_indices', 'sparse_weights', 'dense_weights', 'example_state_data', 'loss_type', 'l1', 'l2', 'num_loss_partitions', 'num_inner_iterations', 'adaptative', 'name'], 143 'tf.train.sdca_shrink_l1': ['weights', 'l1', 'l2', 'name'], 144 'tf.transpose': ['a', 'perm', 'name', 'conjugate'], 145 'tf.tuple': ['tensors', 'name', 'control_inputs'], 146 'tf.uniform_unit_scaling_initializer': ['factor', 'seed', 'dtype'], 147 'tf.while_loop': ['cond', 'body', 'loop_vars', 'shape_invariants', 'parallel_iterations', 'back_prop', 'swap_memory', 'name', 'maximum_iterations', 'return_same_structure'] 148} 149