New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve shape function of tf.sparse_concat when inputs are fully defined #24018
Improve shape function of tf.sparse_concat when inputs are fully defined #24018
Conversation
This fix tries to address the issue raised in 21964 where the shape function of tf.sparse_concat always returns `TensorShape([Dimension(None), Dimension(None)])` even if the inputs are fully defined. This fix addresses the issue by finding the shape if the inputs are fully defined. This fix fixes 21964. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Nagging Reviewer @ebrevdo: You have been added as a reviewer to this pull request. Please add your review or reassign. It has been 29 days with no activity and the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just a minor nit
tensorflow/python/ops/sparse_ops.py
Outdated
dim = sum(shape[axis] for shape in shapes_value) | ||
output_shape = shapes_value[0] | ||
output_shape[axis] = dim | ||
output_shape = tensor_shape.as_shape(output_shape) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think output_shape is supposed to be a tensor and not a tensorshape
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
PiperOrigin-RevId: 248764459
This fix tries to address the issue raised in #21964 where the shape function of tf.sparse_concat always returns
TensorShape([Dimension(None), Dimension(None)])
even if the inputs are fully defined.This fix addresses the issue by finding the shape if the inputs are fully defined.
This fix fixes #21964.
Signed-off-by: Yong Tang yong.tang.github@outlook.com