A backend is the low-level execution framework beneath Keras. It supplies tensor operations, gradients, and hardware access while Keras provides the higher-level model and training APIs. section 3.6.1 section 3.2
Selecting a Keras backend
Choose the backend before importing Keras. For example, this selects JAX for the current Python process: import os os.environ["KERAS_BACKEND"] = "jax" import keras You can also edit ~/.keras/keras.json. Use "torch" for the PyTorch backend, not "pytorch". A fresh Keras environment uses TensorFlow by default. section 3.6.1
Use these practical rules when choosing or changing a backend:
- Switch among JAX, TensorFlow, and PyTorch without locking Keras code to one ecosystem. section 3.6.1
- Match the backend to the task: debugging, TPU training, or inference tooling can favor different ecosystems. section 3.6.1
- Treat NumPy differently: it supports Keras predictions but cannot support training because it provides no gradient API. section 3.2
Figure 3.4 Keras and its backends. A backend is a low-level tensor-computing platform; Keras is a high-level deep learning API.
Use the diagram to distinguish Keras’s high-level API from the low-level tensor-computing platform supplied by its backend. section 3.6.1



