Skip to content

Commit 2d1f54b

Browse files
committed
add doInitialization() to Runner
Signed-off-by: Ryan Nett <[email protected]>
1 parent ff96645 commit 2d1f54b

File tree

1 file changed

+10
-0
lines changed
  • tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow

1 file changed

+10
-0
lines changed

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java

+10
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,16 @@ public Runner addTarget(Op op) {
293293
return addTarget(op.op());
294294
}
295295

296+
/**
297+
* Make {@link #run} execute the graph's initializers.
298+
*
299+
* @return this session runner
300+
*/
301+
public Runner doInitialization(){
302+
graph.initializers().forEach(this::addTarget);
303+
return this;
304+
}
305+
296306
/**
297307
* Set options (typically for debugging) for this run.
298308
*

0 commit comments

Comments
 (0)