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
[luci-interpreter] Add a feature to infer the output shape #12980
[luci-interpreter] Add a feature to infer the output shape #12980
Conversation
This PR allows the interpreter to determine the unknown output shape, when it is able to infer the output shape. As a result, the output value of the inferred unknown shape can also be output. Signed-off-by: Seungho Henry Park <shs.park@samsung.com>
std::vector<char> output_data(getTensorSize(output_node)); | ||
size_t output_size = interpreter.getOutputTensorSize(output_node); | ||
std::vector<char> output_data(output_size); |
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.
Change to get the size of output_node from the runtime module, not from the shape of origin model.
The runtime module can have inferred shape which is determined in interpreting process.
plz split |
Signed-off-by: Seungho Henry Park <shs.park@samsung.com>
@seanshpark, |
if (tensor == nullptr) | ||
{ | ||
const std::string &name = output_node->name(); | ||
throw std::runtime_error("Cannot find tensor size for output node named \"" + name + "\"."); |
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.
NOTE other methods in this file uses throw std::runtime_error()
for failure exit.
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
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 👍
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 w/ minor comment (https://github.com/Samsung/ONE/pull/12981/files#r1598051074).
This PR makes a new interface
getOutputTensorSize
in the luci-interpreter.This is to get the size of actual output size from the
_runtime_module
, which has the inferred and calculated output shape during the interprete process.for issue #12979
from draft #12981