Open Cookiee235 opened 3 months ago
I assume there's a typo and that cls.transform_params_7
is supposed to be cls.transform_params_2
. With that, I can reproduce your error.
It looks like this is a limitation in the LazyTransformParams
, that it expects a tuple of outputs to be produced within the function, rather than being a return value from a subroutine. There's a couple of options on how this can be worked around:
Use LazyGetInput
and LazySetOutput
, which are intended to replace LazyTransformParams
. These add callback arguments rather than performing lazy-loading through the global "get_item"
or "set_item"
functions, and don't have the same limitations for tuple outputs. (The long-term plan is to replace the implementation of LazyTransformParams
with one that calls LazyGetInput
and LazySetOutput
internally.)
If you only need transform_params
and not transform_params_2
, you could mark transform_params_2
as private, then use relax.transform.InlinePrivateFunctions()
. This would move the (D,D)
tuple into transform_params
, working around the current limitation of LazyTransformParams
.
@Lunderberg Thanks for your investigation. Such information help deeply undestand the usage of different transforms. Due to the incomplete documentation of TVM, understand the usage of each transform based on the source code has some difficulty. Your explanation help me a lot! Thanks again.
Actual behavior
Steps to reproduce
cc @Lunderberg @junrushao