Extend constant prop pass to work with int/float/etc scalars and fix input specs. (#2950)
Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/2950 1. Cleanup / Refactor constant prop pass. 2. Enable constant propagation for ops with constant scalar arguments -- int/float/dtype/bool/str. Nodes of type `Op(constant_tensor, some_int, some_float, some_dtype, ...)` can now be constant propagated. 3. Fix order of input spec to match the expected spec in `ExportGraphSignature` class. parameters->buffers->constants->user_inputs. Before this diff, input_specs for the newly added constant tensors were appended to graph_signature, which would cause failures. Reviewed By: dulinriley Differential Revision: D55891278 fbshipit-source-id: fe1867cb6a99d0140d6a2e076027688cb1ddc0cd
H
Hardik Sharma committed
5ef8427cfe9a0ccc1e13bf49e96892467a20dcf0
Parent: 3b727a7
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 4/11/2024, 10:29:22 PM