Use XLA com tf.function

Ver no TensorFlow.org Executar no Google Colab Ver fonte no GitHub

Este tutorial treina um modelo do TensorFlow para classificar o conjunto de dados MNIST, onde a função de treinamento é compilada usando XLA.

Primeiro, carregue o TensorFlow e habilite a execução rápida.

# In TF 2.4 jit_compile is called experimental_compile
pip install -q tf-nightly
import tensorflow as tf
tf.compat.v1.enable_eager_execution()

Em seguida, defina algumas constantes necessárias e prepare o conjunto de dados MNIST.

# Size of each input image, 28 x 28 pixels
IMAGE_SIZE = 28 * 28
# Number of distinct number labels, [0..9]
NUM_CLASSES = 10
# Number of examples in each training batch (step)
TRAIN_BATCH_SIZE = 100
# Number of training steps to run
TRAIN_STEPS = 1000

# Loads MNIST dataset.
train, test = tf.keras.datasets.mnist.load_data()
train_ds = tf.data.Dataset.from_tensor_slices(train).batch(TRAIN_BATCH_SIZE).repeat()

# Casting from raw data to the required datatypes.
def cast(images, labels):
  images = tf.cast(
      tf.reshape(images, [-1, IMAGE_SIZE]), tf.float32)
  labels = tf.cast(labels, tf.int64)
  return (images, labels)
Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
11493376/11490434 [==============================] - 0s 0us/step

Finalmente, defina o modelo e o otimizador. O modelo usa uma única camada densa.

layer = tf.keras.layers.Dense(NUM_CLASSES)
optimizer = tf.keras.optimizers.Adam()

Defina a função de treinamento

Na função de treinamento, você obtém os rótulos previstos usando a camada definida acima e, em seguida, minimiza o gradiente da perda usando o otimizador. Para compilar o cálculo usando XLA, coloque-o dentro de tf.function com jit_compile=True .

@tf.function(jit_compile=True)
def train_mnist(images, labels):
    images, labels = cast(images, labels)

    with tf.GradientTape() as tape:
      predicted_labels = layer(images)
      loss = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(
          logits=predicted_labels, labels=labels
      ))
    layer_variables = layer.trainable_variables
    grads = tape.gradient(loss, layer_variables)
    optimizer.apply_gradients(zip(grads, layer_variables))

Treine e teste o modelo

Depois de definir a função de treinamento, defina o modelo.

for images, labels in train_ds:
  if optimizer.iterations > TRAIN_STEPS:
    break
  train_mnist(images, labels)

E, finalmente, verifique a precisão:

images, labels = cast(test[0], test[1])
predicted_labels = layer(images)
correct_prediction = tf.equal(tf.argmax(predicted_labels, 1), labels)
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
print("Prediction accuracy after training: %s" % accuracy)
Prediction accuracy after training: tf.Tensor(0.8799, shape=(), dtype=float32)

Nos bastidores, o compilador XLA compilou toda a função TF para HLO, o que permitiu otimizações de fusão. Usando os recursos de introspecção, podemos ver o código HLO (outros valores possíveis interessantes para "estágio" são optimized_hlo para HLO após otimizações e optimized_hlo_dot para um gráfico Graphviz):

print(train_mnist.experimental_get_compiler_ir(images, labels)(stage='hlo'))
HloModule a_inference_train_mnist_5289__.198, input_output_alias={ {0}: (2, {}, may-alias), {1}: (3, {}, may-alias), {2}: (5, {}, may-alias), {3}: (8, {}, may-alias), {4}: (9, {}, may-alias), {5}: (10, {}, may-alias), {6}: (11, {}, may-alias) }

%max_float_.59 (x.60: f32[], y.61: f32[]) -> f32[] {
  %x.60 = f32[] parameter(0)
  %y.61 = f32[] parameter(1)
  ROOT %maximum.62 = f32[] maximum(f32[] %x.60, f32[] %y.61)
}

%add_float_.69 (x.70: f32[], y.71: f32[]) -> f32[] {
  %x.70 = f32[] parameter(0)
  %y.71 = f32[] parameter(1)
  ROOT %add.72 = f32[] add(f32[] %x.70, f32[] %y.71)
}

%add_float_.88 (x.89: f32[], y.90: f32[]) -> f32[] {
  %x.89 = f32[] parameter(0)
  %y.90 = f32[] parameter(1)
  ROOT %add.91 = f32[] add(f32[] %x.89, f32[] %y.90)
}

%Mean-reduction.100 (x.101: f32[], y.102: f32[]) -> f32[] {
  %x.101 = f32[] parameter(0)
  %y.102 = f32[] parameter(1)
  ROOT %add.103 = f32[] add(f32[] %x.101, f32[] %y.102)
}

%add_float_.116 (x.117: f32[], y.118: f32[]) -> f32[] {
  %x.117 = f32[] parameter(0)
  %y.118 = f32[] parameter(1)
  ROOT %add.119 = f32[] add(f32[] %x.117, f32[] %y.118)
}

ENTRY %a_inference_train_mnist_5289__.198 (arg0.1: f32[10000,784], arg1.2: s64[10000], arg2.3: f32[784,10], arg3.4: f32[10], arg4.5: f32[], arg5.6: s64[], arg6.7: f32[], arg7.8: f32[], arg8.9: f32[784,10], arg9.10: f32[784,10], arg10.11: f32[10], arg11.12: f32[10]) -> (f32[784,10], f32[10], s64[], f32[784,10], f32[784,10], f32[10], f32[10]) {
  %constant.15 = f32[] constant(1), metadata={op_type="Sub" op_name="Adam/sub_2" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=151}
  %arg6.7 = f32[] parameter(6), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %subtract.16 = f32[] subtract(f32[] %constant.15, f32[] %arg6.7), metadata={op_type="Sub" op_name="Adam/sub_2" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=151}
  %constant.17 = f32[] constant(1), metadata={op_type="Sub" op_name="Adam/sub_3" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=154}
  %arg7.8 = f32[] parameter(7), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %subtract.18 = f32[] subtract(f32[] %constant.17, f32[] %arg7.8), metadata={op_type="Sub" op_name="Adam/sub_3" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=154}
  %arg4.5 = f32[] parameter(4), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %constant.26 = f32[] constant(1), metadata={op_type="Sub" op_name="Adam/sub" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=143}
  %arg5.6 = s64[] parameter(5), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %constant.19 = s64[] constant(1), metadata={op_type="AddV2" op_name="Adam/add" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=137}
  %add.20 = s64[] add(s64[] %arg5.6, s64[] %constant.19), metadata={op_type="AddV2" op_name="Adam/add" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=137}
  %convert.21 = f32[] convert(s64[] %add.20), metadata={op_type="Cast" op_name="Adam/Cast_1" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=137}
  %power.25 = f32[] power(f32[] %arg7.8, f32[] %convert.21), metadata={op_type="Pow" op_name="Adam/Pow_1" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=141}
  %subtract.27 = f32[] subtract(f32[] %constant.26, f32[] %power.25), metadata={op_type="Sub" op_name="Adam/sub" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=143}
  %sqrt.28 = f32[] sqrt(f32[] %subtract.27), metadata={op_type="Sqrt" op_name="Adam/Sqrt" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=143}
  %constant.23 = f32[] constant(1), metadata={op_type="Sub" op_name="Adam/sub_1" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=143}
  %power.22 = f32[] power(f32[] %arg6.7, f32[] %convert.21), metadata={op_type="Pow" op_name="Adam/Pow" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=140}
  %subtract.24 = f32[] subtract(f32[] %constant.23, f32[] %power.22), metadata={op_type="Sub" op_name="Adam/sub_1" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=143}
  %divide.29 = f32[] divide(f32[] %sqrt.28, f32[] %subtract.24), metadata={op_type="RealDiv" op_name="Adam/truediv" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=143}
  %multiply.30 = f32[] multiply(f32[] %arg4.5, f32[] %divide.29), metadata={op_type="Mul" op_name="Adam/mul" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=143}
  %arg1.2 = s64[10000]{0} parameter(1), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %reshape.14 = s64[10000]{0} reshape(s64[10000]{0} %arg1.2)
  %broadcast.41 = s64[10000,10]{1,0} broadcast(s64[10000]{0} %reshape.14), dimensions={0}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %iota.40 = s64[10000,10]{1,0} iota(), iota_dimension=1, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %compare.42 = pred[10000,10]{1,0} compare(s64[10000,10]{1,0} %broadcast.41, s64[10000,10]{1,0} %iota.40), direction=EQ, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.37 = f32[] constant(1), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %broadcast.39 = f32[10000,10]{1,0} broadcast(f32[] %constant.37), dimensions={}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.36 = f32[] constant(0), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %broadcast.38 = f32[10000,10]{1,0} broadcast(f32[] %constant.36), dimensions={}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %select.43 = f32[10000,10]{1,0} select(pred[10000,10]{1,0} %compare.42, f32[10000,10]{1,0} %broadcast.39, f32[10000,10]{1,0} %broadcast.38), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.51 = s64[] constant(0), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %broadcast.52 = s64[10000]{0} broadcast(s64[] %constant.51), dimensions={}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %compare.53 = pred[10000]{0} compare(s64[10000]{0} %broadcast.52, s64[10000]{0} %reshape.14), direction=LE, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.48 = s64[] constant(10), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %broadcast.49 = s64[10000]{0} broadcast(s64[] %constant.48), dimensions={}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %compare.50 = pred[10000]{0} compare(s64[10000]{0} %reshape.14, s64[10000]{0} %broadcast.49), direction=LT, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %and.54 = pred[10000]{0} and(pred[10000]{0} %compare.53, pred[10000]{0} %compare.50), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.46 = f32[] constant(0), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %broadcast.47 = f32[10000]{0} broadcast(f32[] %constant.46), dimensions={}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.44 = f32[] constant(nan), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %broadcast.45 = f32[10000]{0} broadcast(f32[] %constant.44), dimensions={}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %select.55 = f32[10000]{0} select(pred[10000]{0} %and.54, f32[10000]{0} %broadcast.47, f32[10000]{0} %broadcast.45), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %broadcast.56 = f32[10000,10]{1,0} broadcast(f32[10000]{0} %select.55), dimensions={0}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %add.57 = f32[10000,10]{1,0} add(f32[10000,10]{1,0} %select.43, f32[10000,10]{1,0} %broadcast.56), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %negate.84 = f32[10000,10]{1,0} negate(f32[10000,10]{1,0} %add.57), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.80 = f32[] constant(0), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %broadcast.81 = f32[10000,10]{1,0} broadcast(f32[] %constant.80), dimensions={}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %compare.82 = pred[10000,10]{1,0} compare(f32[10000,10]{1,0} %add.57, f32[10000,10]{1,0} %broadcast.81), direction=EQ, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.78 = f32[] constant(0), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %broadcast.79 = f32[10000,10]{1,0} broadcast(f32[] %constant.78), dimensions={}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %arg0.1 = f32[10000,784]{1,0} parameter(0), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %reshape.13 = f32[10000,784]{1,0} reshape(f32[10000,784]{1,0} %arg0.1)
  %reshape.31 = f32[10000,784]{1,0} reshape(f32[10000,784]{1,0} %reshape.13), metadata={op_type="Reshape" op_name="Reshape" source_file="<ipython-input-1-a83a9da7b39d>" source_line=16}
  %arg2.3 = f32[784,10]{1,0} parameter(2), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %dot.32 = f32[10000,10]{1,0} dot(f32[10000,784]{1,0} %reshape.31, f32[784,10]{1,0} %arg2.3), lhs_contracting_dims={1}, rhs_contracting_dims={0}, metadata={op_type="MatMul" op_name="dense/MatMul" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/layers/ops/core.py" source_line=53}
  %transpose.33 = f32[10000,10]{1,0} transpose(f32[10000,10]{1,0} %dot.32), dimensions={0,1}, metadata={op_type="MatMul" op_name="dense/MatMul" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/layers/ops/core.py" source_line=53}
  %arg3.4 = f32[10]{0} parameter(3), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %broadcast.34 = f32[10000,10]{1,0} broadcast(f32[10]{0} %arg3.4), dimensions={1}, metadata={op_type="BiasAdd" op_name="dense/BiasAdd" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/layers/ops/core.py" source_line=64}
  %add.35 = f32[10000,10]{1,0} add(f32[10000,10]{1,0} %transpose.33, f32[10000,10]{1,0} %broadcast.34), metadata={op_type="BiasAdd" op_name="dense/BiasAdd" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/layers/ops/core.py" source_line=64}
  %constant.58 = f32[] constant(-inf), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %reduce.63 = f32[10000]{0} reduce(f32[10000,10]{1,0} %add.35, f32[] %constant.58), dimensions={1}, to_apply=%max_float_.59, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %broadcast.64 = f32[10000,10]{1,0} broadcast(f32[10000]{0} %reduce.63), dimensions={0}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %subtract.65 = f32[10000,10]{1,0} subtract(f32[10000,10]{1,0} %add.35, f32[10000,10]{1,0} %broadcast.64), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %exponential.66 = f32[10000,10]{1,0} exponential(f32[10000,10]{1,0} %subtract.65), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %convert.67 = f32[10000,10]{1,0} convert(f32[10000,10]{1,0} %exponential.66), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.68 = f32[] constant(0), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %reduce.73 = f32[10000]{0} reduce(f32[10000,10]{1,0} %convert.67, f32[] %constant.68), dimensions={1}, to_apply=%add_float_.69, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %convert.74 = f32[10000]{0} convert(f32[10000]{0} %reduce.73), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %log.75 = f32[10000]{0} log(f32[10000]{0} %convert.74), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %broadcast.76 = f32[10000,10]{1,0} broadcast(f32[10000]{0} %log.75), dimensions={0}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %subtract.77 = f32[10000,10]{1,0} subtract(f32[10000,10]{1,0} %subtract.65, f32[10000,10]{1,0} %broadcast.76), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %select.83 = f32[10000,10]{1,0} select(pred[10000,10]{1,0} %compare.82, f32[10000,10]{1,0} %broadcast.79, f32[10000,10]{1,0} %subtract.77), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %multiply.85 = f32[10000,10]{1,0} multiply(f32[10000,10]{1,0} %negate.84, f32[10000,10]{1,0} %select.83), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %convert.87 = f32[10000,10]{1,0} convert(f32[10000,10]{1,0} %multiply.85), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.86 = f32[] constant(0), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %reduce.92 = f32[10000]{0} reduce(f32[10000,10]{1,0} %convert.87, f32[] %constant.86), dimensions={1}, to_apply=%add_float_.88, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %convert.93 = f32[10000]{0} convert(f32[10000]{0} %reduce.92), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %convert.97 = f32[10000]{0} convert(f32[10000]{0} %convert.93), metadata={op_type="Mean" op_name="Mean" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.98 = f32[] constant(0), metadata={op_type="Mean" op_name="Mean" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %convert.99 = f32[] convert(f32[] %constant.98), metadata={op_type="Mean" op_name="Mean" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %reduce.104 = f32[] reduce(f32[10000]{0} %convert.97, f32[] %convert.99), dimensions={0}, to_apply=%Mean-reduction.100, metadata={op_type="Mean" op_name="Mean" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %constant.105 = s32[] constant(10000), metadata={op_type="Mean" op_name="Mean" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %convert.106 = f32[] convert(s32[] %constant.105), metadata={op_type="Mean" op_name="Mean" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %divide.107 = f32[] divide(f32[] %reduce.104, f32[] %convert.106), metadata={op_type="Mean" op_name="Mean" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %convert.108 = f32[] convert(f32[] %divide.107), metadata={op_type="Mean" op_name="Mean" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %arg8.9 = f32[784,10]{1,0} parameter(8), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %constant.109 = f32[] constant(0.0001), metadata={op_type="Mul" op_name="gradient_tape/SparseSoftmaxCrossEntropyWithLogits/mul" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=11}
  %broadcast.110 = f32[10000,1]{1,0} broadcast(f32[] %constant.109), dimensions={}, metadata={op_type="Mul" op_name="gradient_tape/SparseSoftmaxCrossEntropyWithLogits/mul" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=11}
  %reshape.111 = f32[10000]{0} reshape(f32[10000,1]{1,0} %broadcast.110), metadata={op_type="Mul" op_name="gradient_tape/SparseSoftmaxCrossEntropyWithLogits/mul" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=11}
  %broadcast.112 = f32[10000,10]{1,0} broadcast(f32[10000]{0} %reshape.111), dimensions={0}, metadata={op_type="Mul" op_name="gradient_tape/SparseSoftmaxCrossEntropyWithLogits/mul" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=11}
  %broadcast.94 = f32[10000,10]{1,0} broadcast(f32[10000]{0} %convert.74), dimensions={0}, metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %divide.95 = f32[10000,10]{1,0} divide(f32[10000,10]{1,0} %exponential.66, f32[10000,10]{1,0} %broadcast.94), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %subtract.96 = f32[10000,10]{1,0} subtract(f32[10000,10]{1,0} %divide.95, f32[10000,10]{1,0} %add.57), metadata={op_type="SparseSoftmaxCrossEntropyWithLogits" op_name="SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=7}
  %multiply.113 = f32[10000,10]{1,0} multiply(f32[10000,10]{1,0} %broadcast.112, f32[10000,10]{1,0} %subtract.96), metadata={op_type="Mul" op_name="gradient_tape/SparseSoftmaxCrossEntropyWithLogits/mul" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=11}
  %dot.147 = f32[784,10]{1,0} dot(f32[10000,784]{1,0} %reshape.31, f32[10000,10]{1,0} %multiply.113), lhs_contracting_dims={0}, rhs_contracting_dims={0}, metadata={op_type="MatMul" op_name="gradient_tape/dense/MatMul" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=11}
  %transpose.148 = f32[784,10]{1,0} transpose(f32[784,10]{1,0} %dot.147), dimensions={0,1}, metadata={op_type="MatMul" op_name="gradient_tape/dense/MatMul" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=11}
  %subtract.157 = f32[784,10]{1,0} subtract(f32[784,10]{1,0} %transpose.148, f32[784,10]{1,0} %arg8.9), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %constant.150 = f32[] constant(1), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.156 = f32[] subtract(f32[] %constant.150, f32[] %arg6.7), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %broadcast.158 = f32[784,10]{1,0} broadcast(f32[] %subtract.156), dimensions={}, metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %multiply.159 = f32[784,10]{1,0} multiply(f32[784,10]{1,0} %subtract.157, f32[784,10]{1,0} %broadcast.158), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %add.160 = f32[784,10]{1,0} add(f32[784,10]{1,0} %arg8.9, f32[784,10]{1,0} %multiply.159), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.152 = f32[] subtract(f32[] %constant.150, f32[] %power.25), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %sqrt.153 = f32[] sqrt(f32[] %subtract.152), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %multiply.154 = f32[] multiply(f32[] %arg4.5, f32[] %sqrt.153), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.151 = f32[] subtract(f32[] %constant.150, f32[] %power.22), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %divide.155 = f32[] divide(f32[] %multiply.154, f32[] %subtract.151), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %broadcast.170 = f32[784,10]{1,0} broadcast(f32[] %divide.155), dimensions={}, metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %multiply.171 = f32[784,10]{1,0} multiply(f32[784,10]{1,0} %add.160, f32[784,10]{1,0} %broadcast.170), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %arg9.10 = f32[784,10]{1,0} parameter(9), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %multiply.162 = f32[784,10]{1,0} multiply(f32[784,10]{1,0} %transpose.148, f32[784,10]{1,0} %transpose.148), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.163 = f32[784,10]{1,0} subtract(f32[784,10]{1,0} %multiply.162, f32[784,10]{1,0} %arg9.10), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.161 = f32[] subtract(f32[] %constant.150, f32[] %arg7.8), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %broadcast.164 = f32[784,10]{1,0} broadcast(f32[] %subtract.161), dimensions={}, metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %multiply.165 = f32[784,10]{1,0} multiply(f32[784,10]{1,0} %subtract.163, f32[784,10]{1,0} %broadcast.164), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %add.166 = f32[784,10]{1,0} add(f32[784,10]{1,0} %arg9.10, f32[784,10]{1,0} %multiply.165), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %sqrt.167 = f32[784,10]{1,0} sqrt(f32[784,10]{1,0} %add.166), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %constant.149 = f32[] constant(1e-07), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %broadcast.168 = f32[784,10]{1,0} broadcast(f32[] %constant.149), dimensions={}, metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %add.169 = f32[784,10]{1,0} add(f32[784,10]{1,0} %sqrt.167, f32[784,10]{1,0} %broadcast.168), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %divide.172 = f32[784,10]{1,0} divide(f32[784,10]{1,0} %multiply.171, f32[784,10]{1,0} %add.169), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.173 = f32[784,10]{1,0} subtract(f32[784,10]{1,0} %arg2.3, f32[784,10]{1,0} %divide.172), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %reshape.176 = f32[784,10]{1,0} reshape(f32[784,10]{1,0} %subtract.173), metadata={op_name="XLA_Retvals"}
  %tuple.177 = (f32[784,10]{1,0}) tuple(f32[784,10]{1,0} %reshape.176), metadata={op_name="XLA_Retvals"}
  %get-tuple-element.178 = f32[784,10]{1,0} get-tuple-element((f32[784,10]{1,0}) %tuple.177), index=0, metadata={op_name="XLA_Retvals"}
  %arg10.11 = f32[10]{0} parameter(10), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %convert.114 = f32[10000,10]{1,0} convert(f32[10000,10]{1,0} %multiply.113), metadata={op_type="BiasAddGrad" op_name="gradient_tape/dense/BiasAdd/BiasAddGrad" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=11}
  %constant.115 = f32[] constant(0), metadata={op_type="BiasAddGrad" op_name="gradient_tape/dense/BiasAdd/BiasAddGrad" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=11}
  %reduce.120 = f32[10]{0} reduce(f32[10000,10]{1,0} %convert.114, f32[] %constant.115), dimensions={0}, to_apply=%add_float_.116, metadata={op_type="BiasAddGrad" op_name="gradient_tape/dense/BiasAdd/BiasAddGrad" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=11}
  %convert.121 = f32[10]{0} convert(f32[10]{0} %reduce.120), metadata={op_type="BiasAddGrad" op_name="gradient_tape/dense/BiasAdd/BiasAddGrad" source_file="<ipython-input-1-5e734cf0c4f9>" source_line=11}
  %subtract.130 = f32[10]{0} subtract(f32[10]{0} %convert.121, f32[10]{0} %arg10.11), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %constant.123 = f32[] constant(1), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.129 = f32[] subtract(f32[] %constant.123, f32[] %arg6.7), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %broadcast.131 = f32[10]{0} broadcast(f32[] %subtract.129), dimensions={}, metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %multiply.132 = f32[10]{0} multiply(f32[10]{0} %subtract.130, f32[10]{0} %broadcast.131), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %add.133 = f32[10]{0} add(f32[10]{0} %arg10.11, f32[10]{0} %multiply.132), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.125 = f32[] subtract(f32[] %constant.123, f32[] %power.25), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %sqrt.126 = f32[] sqrt(f32[] %subtract.125), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %multiply.127 = f32[] multiply(f32[] %arg4.5, f32[] %sqrt.126), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.124 = f32[] subtract(f32[] %constant.123, f32[] %power.22), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %divide.128 = f32[] divide(f32[] %multiply.127, f32[] %subtract.124), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %broadcast.143 = f32[10]{0} broadcast(f32[] %divide.128), dimensions={}, metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %multiply.144 = f32[10]{0} multiply(f32[10]{0} %add.133, f32[10]{0} %broadcast.143), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %arg11.12 = f32[10]{0} parameter(11), parameter_replication={false}, metadata={op_name="XLA_Args"}
  %multiply.135 = f32[10]{0} multiply(f32[10]{0} %convert.121, f32[10]{0} %convert.121), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.136 = f32[10]{0} subtract(f32[10]{0} %multiply.135, f32[10]{0} %arg11.12), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.134 = f32[] subtract(f32[] %constant.123, f32[] %arg7.8), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %broadcast.137 = f32[10]{0} broadcast(f32[] %subtract.134), dimensions={}, metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %multiply.138 = f32[10]{0} multiply(f32[10]{0} %subtract.136, f32[10]{0} %broadcast.137), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %add.139 = f32[10]{0} add(f32[10]{0} %arg11.12, f32[10]{0} %multiply.138), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %sqrt.140 = f32[10]{0} sqrt(f32[10]{0} %add.139), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %constant.122 = f32[] constant(1e-07), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %broadcast.141 = f32[10]{0} broadcast(f32[] %constant.122), dimensions={}, metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %add.142 = f32[10]{0} add(f32[10]{0} %sqrt.140, f32[10]{0} %broadcast.141), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %divide.145 = f32[10]{0} divide(f32[10]{0} %multiply.144, f32[10]{0} %add.142), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %subtract.146 = f32[10]{0} subtract(f32[10]{0} %arg3.4, f32[10]{0} %divide.145), metadata={op_type="ResourceApplyAdam" op_name="Adam/Adam/update_1/ResourceApplyAdam" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/adam.py" source_line=186}
  %reshape.179 = f32[10]{0} reshape(f32[10]{0} %subtract.146), metadata={op_name="XLA_Retvals"}
  %tuple.180 = (f32[10]{0}) tuple(f32[10]{0} %reshape.179), metadata={op_name="XLA_Retvals"}
  %get-tuple-element.181 = f32[10]{0} get-tuple-element((f32[10]{0}) %tuple.180), index=0, metadata={op_name="XLA_Retvals"}
  %constant.174 = s64[] constant(1), metadata={op_type="AssignAddVariableOp" op_name="Adam/Adam/AssignAddVariableOp" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/optimizer_v2.py" source_line=732}
  %add.175 = s64[] add(s64[] %arg5.6, s64[] %constant.174), metadata={op_type="AssignAddVariableOp" op_name="Adam/Adam/AssignAddVariableOp" source_file="/tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/keras/optimizer_v2/optimizer_v2.py" source_line=732}
  %reshape.182 = s64[] reshape(s64[] %add.175), metadata={op_name="XLA_Retvals"}
  %tuple.183 = (s64[]) tuple(s64[] %reshape.182), metadata={op_name="XLA_Retvals"}
  %get-tuple-element.184 = s64[] get-tuple-element((s64[]) %tuple.183), index=0, metadata={op_name="XLA_Retvals"}
  %reshape.185 = f32[784,10]{1,0} reshape(f32[784,10]{1,0} %add.160), metadata={op_name="XLA_Retvals"}
  %tuple.186 = (f32[784,10]{1,0}) tuple(f32[784,10]{1,0} %reshape.185), metadata={op_name="XLA_Retvals"}
  %get-tuple-element.187 = f32[784,10]{1,0} get-tuple-element((f32[784,10]{1,0}) %tuple.186), index=0, metadata={op_name="XLA_Retvals"}
  %reshape.188 = f32[784,10]{1,0} reshape(f32[784,10]{1,0} %add.166), metadata={op_name="XLA_Retvals"}
  %tuple.189 = (f32[784,10]{1,0}) tuple(f32[784,10]{1,0} %reshape.188), metadata={op_name="XLA_Retvals"}
  %get-tuple-element.190 = f32[784,10]{1,0} get-tuple-element((f32[784,10]{1,0}) %tuple.189), index=0, metadata={op_name="XLA_Retvals"}
  %reshape.191 = f32[10]{0} reshape(f32[10]{0} %add.133), metadata={op_name="XLA_Retvals"}
  %tuple.192 = (f32[10]{0}) tuple(f32[10]{0} %reshape.191), metadata={op_name="XLA_Retvals"}
  %get-tuple-element.193 = f32[10]{0} get-tuple-element((f32[10]{0}) %tuple.192), index=0, metadata={op_name="XLA_Retvals"}
  %reshape.194 = f32[10]{0} reshape(f32[10]{0} %add.139), metadata={op_name="XLA_Retvals"}
  %tuple.195 = (f32[10]{0}) tuple(f32[10]{0} %reshape.194), metadata={op_name="XLA_Retvals"}
  %get-tuple-element.196 = f32[10]{0} get-tuple-element((f32[10]{0}) %tuple.195), index=0, metadata={op_name="XLA_Retvals"}
  ROOT %tuple.197 = (f32[784,10]{1,0}, f32[10]{0}, s64[], f32[784,10]{1,0}, f32[784,10]{1,0}, f32[10]{0}, f32[10]{0}) tuple(f32[784,10]{1,0} %get-tuple-element.178, f32[10]{0} %get-tuple-element.181, s64[] %get-tuple-element.184, f32[784,10]{1,0} %get-tuple-element.187, f32[784,10]{1,0} %get-tuple-element.190, f32[10]{0} %get-tuple-element.193, f32[10]{0} %get-tuple-element.196), metadata={op_name="XLA_Retvals"}
}