aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/go/op/scope.go
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/go/op/scope.go')
-rw-r--r--tensorflow/go/op/scope.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/go/op/scope.go b/tensorflow/go/op/scope.go
index d87833f451..a9ec79463a 100644
--- a/tensorflow/go/op/scope.go
+++ b/tensorflow/go/op/scope.go
@@ -49,6 +49,11 @@ func NewScope() *Scope {
return &Scope{graph: tf.NewGraph(), namemap: make(map[string]int), err: new(scopeErr)}
}
+// NewScopeWithGraph creates a Scope initialized with the Graph thats passed in
+func NewScopeWithGraph(g *tf.Graph) *Scope {
+ return &Scope{graph: g, namemap: make(map[string]int), err: new(scopeErr)}
+}
+
// Finalize returns the Graph on which this scope operates on and renders s
// unusable. If there was an error during graph construction, that error is
// returned instead.