Add assertions to SplatElementsAttr and ConstantOp builders and fix failures
1) Fix FloatAttr type inconsistency in conversion from tf.FusedBatchNorm to TFLite ops We used to compose the splat tensor out of the scalar epsilon attribute by using the type of the variance operand. However, the epsilon attribute may have a different bitwidth than the one in the variance operand. So it ends up we were creating inconsistent types within the FloatAttr itself. 2) Fix SplatElementsAttr type inconsistency in AnnotateInputArrays We need to create the zero-valued attribute according to the type provided as the command-line arguments. 3) Concretize the result type of tf.Shape constant folding test case Currently the resultant constant is created by the constant folding harness, using the result type of the original op as the constant's result type. That can be a different type than the constant's internal DenseElementsAttr. PiperOrigin-RevId: 230244665
Loading
Please sign in to comment