Imported Upstream version 1.21.0
[platform/core/ml/nnfw.git] / res / TensorFlowPythonExamples / examples / rnn / __init__.py
1 import tensorflow as tf
2 from tensorflow import keras
3
4 tf.compat.v1.disable_eager_execution()
5
6 model = keras.Sequential()
7 shape = (4, 4)
8 model.add(keras.layers.SimpleRNN(2, input_shape=shape))
9
10 # Note that this code will generate pb model only with TF 1.x.x
11 #
12 # to save model in TF 2.x.x use
13 # - to dump keras model: model.save("rnn.h5")
14 # - to dump saved model: tf.saved_model.save(model, "rnn")