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

Add all keep nodes to output lists #20794

Merged
merged 2 commits into from
Jul 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion tensorflow/contrib/tensorrt/convert/trt_optimization_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,14 @@ tensorflow::Status TRTOptimizationPass::Optimize(
tensorflow::grappler::GraphProperties static_graph_properties(item);
TF_RETURN_IF_ERROR(static_graph_properties.InferStatically(true));
tensorflow::tensorrt::convert::ConversionParams cp;

std::vector<string> nodes_to_preserve;
for (const auto& n : item.NodesToPreserve()) {
auto tokens = str_util::Split(n, ":");
nodes_to_preserve.push_back(tokens.at(0));
}
cp.input_graph_def = &item.graph;
cp.output_names = &item.fetch;
cp.output_names = &nodes_to_preserve;
cp.max_batch_size = maximum_batch_size_;
cp.max_workspace_size_bytes = maximum_workspace_size_;
cp.output_graph_def = optimized_graph;
Expand Down