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

Adding more unit tests for ChannelHolder class #8668

Merged

Conversation

abhinavarora
Copy link
Contributor

No description provided.

Copy link
Contributor

@chengduoZH chengduoZH left a comment

Choose a reason for hiding this comment

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

The unit tests are so many now!

delete ch;
}

TEST(ChannelHolder, TypeMismatchSendTest) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Checking type matching or not isn't the function of Channel, is it necessary to add the unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Channel enforces the datatype in send (https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/framework/channel.h#L74) and receive (https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/framework/channel.h#L81)

The channel makes sure that the variable being sent or received is same as the type of the channel. The unit test is to make sure the paddle enforce is executed.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, thanks!

@abhinavarora abhinavarora merged commit 01536e8 into PaddlePaddle:develop Mar 1, 2018
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.

2 participants