Add a toplevel warning against legacy keras.preprocessing utilities
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
-"""Provides keras data preprocessing utils to pre-process tf.data.Datasets before they are fed to the model."""
+"""Utilities to preprocess data before training.
+
+Warning: `tf.keras.preprocessing` APIs do not operate on tensors and are
+not recommended for new code. Prefer loading data with either
+`tf.keras.utils.text_dataset_from_directory` or
+`tf.keras.utils.image_dataset_from_directory`, and then transforming the output
+`tf.data.Dataset` with preprocessing layers. These approaches will offer
+better performance and intergration with the broader Tensorflow ecosystem. For
+more information, see the tutorials for [loading text](
+https://www.tensorflow.org/tutorials/load_data/text), [loading images](
+https://www.tensorflow.org/tutorials/load_data/images), and [augmenting images](
+https://www.tensorflow.org/tutorials/images/data_augmentation), as well as the
+[preprocessing layer guide](
+https://www.tensorflow.org/guide/keras/preprocessing_layers).
+"""
from keras import backend
from keras.preprocessing import image
from keras.preprocessing import sequence
