Skip to content
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

Enhance error message when x or y is empty in elementwise_op #33928

Merged
merged 3 commits into from
Jul 5, 2021

Conversation

zhiqiu
Copy link
Contributor

@zhiqiu zhiqiu commented Jul 2, 2021

PR types

Others

PR changes

OPs

Describe

Enhance error message when x or y is empty in elementwise_op

import paddle
import numpy as np
paddle.set_device('cpu')

weight_arr = np.array([], dtype=np.float32)
weight = paddle.to_tensor(np.reshape(weight_arr, (1, 8, 0)))

x_arr = np.array([], dtype=np.float32)
x = paddle.to_tensor(np.reshape(x_arr, (0, 0, 0)))

y_arr = np.array([], dtype=np.float32)
y = paddle.to_tensor(np.reshape(y_arr, (0, 0, 0)))

bce_loss = paddle.nn.BCELoss(weight, 'none')
bce_loss(x, y)

# ValueError: (InvalidArgument) The input X should not be empty

@paddle-bot-old
Copy link

paddle-bot-old bot commented Jul 2, 2021

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@CLAassistant
Copy link

CLAassistant commented Jul 2, 2021

CLA assistant check
All committers have signed the CLA.

@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Jul 2, 2021
@PaddlePaddle PaddlePaddle unlocked this conversation Jul 2, 2021
@zhiqiu zhiqiu merged commit 70100e4 into PaddlePaddle:develop Jul 5, 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