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

Fix unit tests and make sure all unit tests pass #385

Merged
merged 2 commits into from
Apr 11, 2018

Conversation

nickyfantasy
Copy link
Contributor

No description provided.

@@ -132,40 +129,6 @@ TEST(Image, add_sample_test) {
CHECK_EQ(image2read.num_records(), num_steps);
}

TEST(Image, add_sample_test) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

So we do not test Image?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we do, its duplicated, add_sample_test already defined

vector<float> data;
for (int j = 0; j < 3 * 5 * 5; j++) {
data.push_back(float(rand()) / RAND_MAX);
vector<int32_t> shape({16000, 2, 2});
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the reason of changing these numbers? What are their meanings? Just want to learn 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

last time I just copied image test and change to audio. Image test they use shape [5,5,3] to represent 5x5 h and w and 3 channels (RGB). In audio, the params are [sample_rate, sample_width, number of channels]

vector<float> data;
for (int j = 0; j < 3 * 5 * 5; j++) {
data.push_back(float(rand()) / RAND_MAX);
vector<uint8_t> data;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also here 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The audio data we accept is vector of uint8_t type, so I randomly pick numbers from rand() % 256 to create a vector

@nickyfantasy nickyfantasy merged commit 42561ce into PaddlePaddle:develop Apr 11, 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.

None yet

2 participants