We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 304dc00 commit 8dfc449Copy full SHA for 8dfc449
tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Init.java
@@ -98,14 +98,10 @@ public static Init create(Scope scope) {
98
@Endpoint(name = "initAdd")
99
public static void add(Scope scope, Op initializer) {
100
ExecutionEnvironment exEnv = scope.env();
101
- if(exEnv.isEager()){
102
- return;
103
- }
104
- if (!(exEnv instanceof Graph)) {
105
- throw new IllegalArgumentException("initAdd is only supported on Graph or eager sessions.");
+
+ if(exEnv.isGraph()) {
+ ((Graph) exEnv).addInitializer(initializer);
106
}
107
- Graph graph = (Graph) exEnv;
108
- graph.addInitializer(initializer);
109
110
111
private Init(Operation operation) {
0 commit comments