NumPy true division promotes integer arrays to float64, and the analysis does not model the promotion: x_train / 255.0 over the uint8 MNIST arrays yields float64 at runtime, but the result's dtype floors at UNKNOWN, and the loss rides through the tf.data pipeline to the training-loop parameters.
Witness: TensorFlow2.0-Examples 2-Basical_Models/CNN.py:27-38: mnist.load_data() (uint8) at :27, / 255.0 at :28 (int-to-float64 promotion by the float literal), [..., tf.newaxis] at :31-32 (dtype-preserving), tf.data.Dataset.from_tensor_slices(...).batch(32) at :35-38. The from_tensor_slices per-index element machinery already carries source dtypes, so modeling the division promotion should deliver the training/test images parameters (float64 [32, 28, 28, 1]) without further dataset work.
NumPy true division promotes integer arrays to float64, and the analysis does not model the promotion:
x_train / 255.0over the uint8 MNIST arrays yields float64 at runtime, but the result's dtype floors atUNKNOWN, and the loss rides through thetf.datapipeline to the training-loop parameters.Witness: TensorFlow2.0-Examples
2-Basical_Models/CNN.py:27-38:mnist.load_data()(uint8) at:27,/ 255.0at:28(int-to-float64 promotion by the float literal),[..., tf.newaxis]at:31-32(dtype-preserving),tf.data.Dataset.from_tensor_slices(...).batch(32)at:35-38. Thefrom_tensor_slicesper-index element machinery already carries source dtypes, so modeling the division promotion should deliver the training/testimagesparameters (float64 [32, 28, 28, 1]) without further dataset work.