You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, when applying TF_GraphGetTensorNumDims to a "Variable" operation,
the functions returns -1, even though the shape and number of dimensions are
well defined.
However, if I do the same for a "Placeholder" operation (by simply replacing
"Variable" with "Placeholder), the returned number of dimensions is 2 (as expected).
It seems to me like a bug. It might be related to the previous issue that
I reported (#5059), since the inability to determine the shape of a tensor at a particular node propagates through the graph.
The text was updated successfully, but these errors were encountered:
Thanks for the detailed report @juraj-bicikl . This particular case is because the C++ function for shape inference for the Variable op is explicitly returning an unknown shape (state_ops.cc). That does seem fishy to me, I'll investigate further and get back to you.
Unfortunately, for historical reasons, the "Variable" op's shape function will not be able to distinguish between an unknown shape or a scalar shape (similar to the Placeholder op). Before the 1.0 release, we are going to try and fix this up. However, in the mean time:
I'm going to try and fix this up for non-scalar shapes
You might consider the workaround for Variable ops where you explicitly set the shape using something like:
For some reason, when applying TF_GraphGetTensorNumDims to a "Variable" operation,
the functions returns -1, even though the shape and number of dimensions are
well defined.
A simple example:
The program returns:
However, if I do the same for a "Placeholder" operation (by simply replacing
"Variable" with "Placeholder), the returned number of dimensions is 2 (as expected).
It seems to me like a bug. It might be related to the previous issue that
I reported (#5059), since the inability to determine the shape of a tensor at a particular node propagates through the graph.
The text was updated successfully, but these errors were encountered: