aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/go/op/scope_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/go/op/scope_test.go')
-rw-r--r--tensorflow/go/op/scope_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/tensorflow/go/op/scope_test.go b/tensorflow/go/op/scope_test.go
index b74fd24b26..6fb5d32e50 100644
--- a/tensorflow/go/op/scope_test.go
+++ b/tensorflow/go/op/scope_test.go
@@ -95,6 +95,21 @@ func TestMultipleGeneratedOps(t *testing.T) {
}
}
+func TestScopeWithGraph(t *testing.T) {
+ s1 := NewScope()
+ Const(s1, "hello")
+ graph, err := s1.Finalize()
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ s2 := NewScopeWithGraph(graph)
+ Const(s2.SubScope("addition"), "world")
+ if err := s2.Err(); err != nil {
+ t.Fatal(err)
+ }
+}
+
func Example() {
// This example creates a Graph that multiplies a constant matrix with
// a matrix to be provided during graph execution (via