tvm
tvm copied to clipboard
[Transform][Bugfix] Handle non-composite lambda functions in FuseOps
trafficstars
Prior to this commit, calling FuseOpsByPattern with annotate_codegen=True would cause an error when encountering a lambda function. This was caused by the CompositeFunctionAnnotator asserting that all relax::Function encountered must have the kComposite attribute. While this is true for all lambda functions produced by FuseOpsByPattern, the user may have defined other lambda functions as well.
This commit updates CompositeFunctionAnnotator to ignore lambda functions that do not have a kComposite attribute.