• Lei Wang's avatar
    [Language][Reshape] Improve variable handling and ensure correctness during Layout Reshape (#1248) · d7164abf
    Lei Wang authored
    * fix
    
    * Refactor tensor reshaping in fp8_lighting_indexer.py
    
    - Replaced the allocation of `s_reshaped` with a reshape operation to improve clarity and performance.
    - Updated the logic in the computation of `s_reshaped` to utilize the reshaped tensor, enhancing the overall functionality of the attention mechanism.
    
    * Refactor analyzer usage in Layout and Fragment reshaping
    
    - Consolidated analyzer logic in the `Reshape` methods of `LayoutNode` and `FragmentNode` to utilize a fallback analyzer, improving code clarity and preventing potential null dereference issues.
    - Updated variable binding and simplification calls to use the selected analyzer consistently, enhancing robustness in shape validation and index computation.
    d7164abf
layout.cc 27.6 KB