Skip to content

Conversation

@aoyulong
Copy link
Contributor

PR types

Others

PR changes

Ops

Describe

The paddle.multiplex will break down when the size of candidate tensors is zero and doesn't give useful an error message. This pr will check the situation and gives user more information.

auto* out = ctx.Output<Tensor>("Out");
out->mutable_data<T>(ctx.GetPlace());

PADDLE_ENFORCE_GT(ins[0]->numel(), 0,
Copy link
Member

Choose a reason for hiding this comment

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

Why only check the first tensor of the input? Shouldn't it be checked more than one becasue of MultiInput type?

Copy link
Contributor Author

@aoyulong aoyulong Sep 24, 2021

Choose a reason for hiding this comment

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

Done.


out->mutable_data<T>(ctx.GetPlace());

PADDLE_ENFORCE_GT(ins[0]->numel(), 0,
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor Author

@aoyulong aoyulong Sep 24, 2021

Choose a reason for hiding this comment

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

Done.


PADDLE_ENFORCE_GT(ins[0]->numel(), 0,
platform::errors::PreconditionNotMet(
"indexing will be out of bounds with size 0."));
Copy link
Member

Choose a reason for hiding this comment

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

indexing->index ? PreconditionNotMet-> OutOfRange?

Copy link
Contributor Author

@aoyulong aoyulong Sep 24, 2021

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@ForFishes ForFishes left a comment

Choose a reason for hiding this comment

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

LGTM

@Xreki Xreki merged commit b430f6a into PaddlePaddle:develop Sep 26, 2021
AnnaTrainingG pushed a commit to AnnaTrainingG/Paddle that referenced this pull request Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants