For reshape() operator, I found that it works with input which is not a tuple. For example:
x = mx.nd.array([1,2,3,4])
y = x.reshape(2,2) # input is not a tuple
# y = [[1. 2.]
# [3. 4.]]
y = x.reshape((2,2))
# y = [[1. 2.]
# [3. 4.]]
However, the bebavior is not consistent in symbol mode for reshape() with non-tuple input. It will raise an error.
It is bothering that when implementing hybrid_forward() in HybridBlock, codes( F.reshape() ) in two modes are the same. We usually disable hybridized mode for debugging (printing shape, context), and then enable it for efficiency. Since error messages in hybridized mode are a little vague, this inconsistent behavior of reshape() makes users hard to realize the reason of the error, and also hard to debug.
Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended label(s): Feature
Hi @chongruo, I'm preparing a RFC to unify symbolic and imperative interfaces and handle the difference in the backend automatically. I'll comment here once the RFC is published. It would resolve this feature request.
Most helpful comment
Hi @chongruo, I'm preparing a RFC to unify symbolic and imperative interfaces and handle the difference in the backend automatically. I'll comment here once the RFC is published. It would resolve this feature request.