File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed
tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -309,11 +309,7 @@ public void checkInput(Op input) {
309309 }
310310
311311 @ Override
312- public synchronized Scope baseScope () {
313- if (baseScope == null ){
314- baseScope = new Scope (this );
315- }
316-
312+ public Scope baseScope () {
317313 return baseScope ;
318314 }
319315
@@ -373,7 +369,7 @@ void detach(Pointer... resources) {
373369 private final WeakPointerScope nativeResources ;
374370 private TFE_Context nativeHandle ;
375371
376- private Scope baseScope = null ;
372+ private final Scope baseScope = new Scope ( this ) ;
377373
378374 private EagerSession (Options options ) {
379375 this .nativeResources = new WeakPointerScope ();
Original file line number Diff line number Diff line change @@ -392,11 +392,7 @@ public void checkInput(Op input) {
392392 }
393393
394394 @ Override
395- public synchronized Scope baseScope () {
396- if (baseScope == null ){
397- baseScope = new Scope (this );
398- }
399-
395+ public Scope baseScope () {
400396 return baseScope ;
401397 }
402398
@@ -702,7 +698,7 @@ synchronized SaverDef saverDef() {
702698 private TF_Graph nativeHandle ;
703699 private int refcount = 0 ;
704700 private SaverDef saverDef ;
705- private Scope baseScope = null ;
701+ private final Scope baseScope = new Scope ( this ) ;
706702
707703 private final List <Op > initializers = new ArrayList <>();
708704
You can’t perform that action at this time.
0 commit comments