Skip to content

Conversation

@tongxin
Copy link
Contributor

@tongxin tongxin commented Nov 15, 2021

PR types

Bug fixes

PR changes

APIs

Describe

Einsum returns a tensor with wrong dimensions when an operand has only a single element but is multidimensional.

Example.

x = paddle.rand([1, 1])
y = paddle.rand([1])
z = paddle.einsum('ij, j', x, y)

z is a tensor with shape []. The correct result should be in shape [1].

This bug gets fixed in this PR.

@tongxin tongxin requested a review from levi131 November 15, 2021 12:47
@tongxin tongxin requested a review from zhiqiu November 16, 2021 06:35
Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@levi131 levi131 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhiqiu zhiqiu merged commit 5237cc0 into PaddlePaddle:develop Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants