Skip to content

Model numpy true-division dtype promotion #781

Description

@khatchad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions