Skip to content

Allow output targets in Session runner #388

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

Merged
merged 1 commit into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ gradleBuild
**/target
.tf_configure.bazelrc
.clwb/

# Deployment Files
settings.xml
pom.xml.asc
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public List<Signature> signatures() {
* @return object that can be used to make calls to a function
* @throws IllegalArgumentException if {@code signatureKey} is not found in this saved model.
*/
public TensorFunction function(String signatureKey) {
public SessionFunction function(String signatureKey) {
SessionFunction function = functions.get(signatureKey);
if (function == null) {
throw new IllegalArgumentException(
Expand All @@ -444,7 +444,7 @@ public TensorFunction function(String signatureKey) {
*
* <p><b>All functions use the bundle's underlying session.</b>
*/
public List<TensorFunction> functions() {
public List<SessionFunction> functions() {
return new ArrayList<>(functions.values());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,13 @@ public Runner fetch(Operand<?> operand) {
* Make {@link #run()} execute {@code operation}, but not return any evaluated {@link Tensor
* Tensors}.
*
* @param operation the string name of the operation to execute
* @param operation Is either the string name of the operation or it is a string of the form
* <tt>operation_name:output_index</tt>, where <tt>output_index</tt> will simply be ignored.
* @return this session runner
* @throws IllegalArgumentException if no operation exists with the provided name
*/
public Runner addTarget(String operation) {
return addTarget(graph.operationOrThrow(operation));
return addTarget(graph.outputOrThrow(operation));
}

/**
Expand Down