3d1e402502
Initial goal was to add SHAPE and RANGE tests, solving part of #18971 This PR achieves that and includes the minimum necessary frontend fixes discovered during implementation so those tests reflect real supported behavior instead of xfail/workarounds. so this PR includes both: **1. New SHAPE/RANGE tests 2. Targeted frontend fixes required to make those tests pass correctly** ## Why These Changes Were Needed - SHAPE conversion previously produced symbolic shape info instead of a tensor output aligned with TFLite SHAPE semantics. - RANGE conversion passed tensor expressions into arange instead of scalar values for constant scalar bounds. - Zero-input TFLite subgraphs (valid for constant-only models such as RANGE without inputs) were blocked by a strict assertion. - Model output collection was brittle for constant/prefetched outputs and could fail when output expressions were not already in the expr table. - As a result, i could not add meaningful SHAPE/RANGE coverage without fixing frontend behavior. ## **Modifications** ### **Frontend Changes** (In tflite_frontend.py): - Updated convert_shape: SHAPE now materializes shape output as a tensor using shape_to_tensor(shape_of(...)) - Applies output dtype casting based on ShapeOptions OutType (int32/int64) - Updated convert_range: Extracts scalar values for start/limit/delta from scalar constants - Calls arange with scalar-like values - Keeps dynamic scalar RANGE explicit as unsupported (raises OpNotImplemented with clear message) - Updated _input_type: Removed assumption that every subgraph must have at least one input - Supports valid zero-input subgraphs - Updated from_tflite output assembly: Resolves outputs via tensor wrappers and get_tensor_expr instead of direct expr-table lookup by name --- **Main functional changes are localized to SHAPE/RANGE conversion and model output/input handling.** --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>