Skip to content

Add graph walking functions to Graph and GraphOperation #232

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 8 commits into from
Mar 18, 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
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ public Output<?>[] outputList(int idx, int length) {

@Override
public <T extends TType> Output<T> output(int idx) {
if (getUnsafeNativeHandle(idx) != null && !getUnsafeNativeHandle(idx).isNull()) {
int numOutputs = this.numOutputs();
if (idx >= numOutputs) {
throw new IndexOutOfBoundsException(
"Can't get output with index " + idx + ", this op only has " + numOutputs + " outputs.");
}

if (idx < 0) {
throw new IndexOutOfBoundsException("Can't get output with index < 0.");
}
}
return new Output<>(this, idx);
}

Expand Down
Loading