Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure Consistent Use of List Type for block_type Shape Argument in s…
…emantic.py and interpreter.py (#5128) ## Description: This pull request addresses a type compatibility issue in the block_type constructor across semantic.py and interpreter.py, specifically where the shape parameter, expected as a List, was being provided as a Tuple in certain cases. This PR is intended to fix issues identified in #4860. ### Summary of Changes: 1. semantic.py - Updates in histogram Function and device_assert: - histogram Function: The shape parameter was previously passed as a Tuple when calling the block_type constructor. This has now been updated to a List to align with the constructor's requirements and ensure type consistency. - device_assert Function: The device_assert function’s cond_ty and cond assignments have been updated similarly. The block_type constructor and create_splat call were previously provided a Tuple; this has been updated to a List in both cases. 2. interpreter.py - Adjustment in ReduceOps.sum Method: - In ReduceOps.sum, the to_tensor function was called with a numpy.ndarray whose shape attribute is a Tuple. This shape is now converted to a List before passing it to block_type. ### New Test Addition: Added a new test to cover scenarios where a histogram operation is followed by a broadcasting operation. Co-authored-by: maxim.m66 <[email protected]> Co-authored-by: Maxim <[email protected]> Co-authored-by: peterbell10 <[email protected]>
- Loading branch information