diff --git a/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py b/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py index 74981b5fbf7..6b94fda0f34 100644 --- a/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py +++ b/tensorflow/examples/saved_model/integration_tests/export_mnist_cnn.py @@ -117,7 +117,7 @@ def wrap_keras_model_for_export(model, batch_input_shape, # the desired argspec. def wrapped(*args, **kwargs): # TODO(arnoegw): Can we use call_fn itself? return call_fn(*args, **kwargs) - traced_call_fn = tf.function(autograph=False)( + traced_call_fn = tf.function( tf_decorator.make_decorator(call_fn, wrapped, decorator_argspec=argspec)) # Now we need to trigger traces for all supported combinations of the diff --git a/tensorflow/examples/saved_model/integration_tests/export_rnn_cell.py b/tensorflow/examples/saved_model/integration_tests/export_rnn_cell.py index 876e3004bca..6a2853f0617 100644 --- a/tensorflow/examples/saved_model/integration_tests/export_rnn_cell.py +++ b/tensorflow/examples/saved_model/integration_tests/export_rnn_cell.py @@ -37,7 +37,7 @@ def main(argv): root.rnn_cell = tf.keras.layers.LSTMCell(units=10, recurrent_initializer=None) # Wrap the rnn_cell.__call__ function and assign to next_state. - root.next_state = tf.function(root.rnn_cell.__call__, autograph=False) + root.next_state = tf.function(root.rnn_cell.__call__) # Wrap the rnn_cell.get_initial_function using a decorator and assign to an # attribute with the same name.