Overview
TensorFlow 2.17, released on August 7, 2024, brings performance improvements for model training and inference.
Main Features
Improved performance
XLA compiler and runtime optimizations deliver significant performance gains on training and inference workloads.
python
import tensorflow as tf
# Simple model with XLA compilation
model = tf.keras.Sequential([
tf.keras.layers.Dense(128, activation='relu'),
tf.keras.layers.Dense(10, activation='softmax'),
])
model.compile(
optimizer='adam',
loss='sparse_categorical_crossentropy',
jit_compile=True, # XLA compilation
)
print(f'TensorFlow {tf.__version__}')
