(t *testing.T)
| 154 | } |
| 155 | |
| 156 | func TestScopeWithGraph(t *testing.T) { |
| 157 | s1 := NewScope() |
| 158 | Const(s1, "hello") |
| 159 | graph, err := s1.Finalize() |
| 160 | if err != nil { |
| 161 | t.Fatal(err) |
| 162 | } |
| 163 | |
| 164 | s2 := NewScopeWithGraph(graph) |
| 165 | Const(s2.SubScope("addition"), "world") |
| 166 | if err := s2.Err(); err != nil { |
| 167 | t.Fatal(err) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func Example() { |
| 172 | // This example creates a Graph that multiplies a constant matrix with |