-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add inference example and unit-test for fit-a-line book chapter #8208
Conversation
|
||
DEFINE_string(dirname, "", "Directory of the inference model."); | ||
|
||
TEST(inference, label_semantic_roles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label_semantic_roles -> fit_a_line
// The second dim of the input tensor should be 13 | ||
// The input data should be >= 0 | ||
SetupTensor<float>( | ||
input, {10, 13}, static_cast<float>(0), static_cast<float>(10)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a variable int64_t batch_size = 10
, then use {batch_size, 13}
here.
|
||
# The input's dimension should be 2-D and the second dim is 13 | ||
# The input data should be >= 0 | ||
tensor_x = numpy.random.uniform(0, 10, [10, 13]).astype("float32") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Define batch_size = 10
, and use [batch_size, 13]
here.
Need to update to the develop branch because the definition of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fix #8201