File tree 1 file changed +3
-3
lines changed
tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ public synchronized Set<GraphOperation> completeSubgraph(Set<Operand<?>> inputs,
280
280
throw new IllegalArgumentException ("Outputs can't be null." );
281
281
}
282
282
283
- Queue <GraphOperation > currents = new LinkedList <>();
283
+ Queue <GraphOperation > currents = new ArrayDeque <>(outputs . size () );
284
284
Set <GraphOperation > seen = new LinkedHashSet <>(inputs .size ());
285
285
Set <GraphOperation > inputOps = new LinkedHashSet <>(inputs .size ());
286
286
@@ -345,7 +345,7 @@ public synchronized Set<GraphOperation> completeSubgraph(Set<Operand<?>> inputs,
345
345
*/
346
346
public Set <GraphOperation > upstreamOps (Set <GraphOperation > outputs ) {
347
347
Set <GraphOperation > seen = new LinkedHashSet <>(outputs .size ());
348
- Queue <GraphOperation > todo = new LinkedList <>(outputs );
348
+ Queue <GraphOperation > todo = new ArrayDeque <>(outputs );
349
349
while (!todo .isEmpty ()) {
350
350
GraphOperation current = todo .poll ();
351
351
@@ -367,7 +367,7 @@ public Set<GraphOperation> upstreamOps(Set<GraphOperation> outputs) {
367
367
*/
368
368
public synchronized Set <GraphOperation > downstreamOps (Set <GraphOperation > inputs ) {
369
369
Set <GraphOperation > seen = new LinkedHashSet <>(inputs .size ());
370
- Queue <GraphOperation > todo = new LinkedList <>(inputs );
370
+ Queue <GraphOperation > todo = new ArrayDeque <>(inputs );
371
371
while (!todo .isEmpty ()) {
372
372
GraphOperation current = todo .poll ();
373
373
You can’t perform that action at this time.
0 commit comments