Unverified Commit fa6e4338 authored by Spenser Bauman's avatar Spenser Bauman Committed by GitHub
Browse files

[mlir][tosa] Fix assertion failure in tosa-layerwise-constant-fold (#85670)



The existing implementation of tosa-layerwise-constant-fold only works
for constant values backed by DenseElementsAttr. For constants which
hold DenseResourceAttrs, the folder will end up asserting at runtime, as
it assumes that the backing data can always be accessed through
ElementsAttr::getValues.

This change reworks the logic so that types types used to perform
folding are based on whether the ElementsAttr can be converted to a
range of that particular type.

---------

Co-authored-by: default avatarSpenser Bauman <sabauma@mathworks.com>
Co-authored-by: default avatarTina Jung <tinamaria.jung@amd.com>
parent 73402634
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment