()
| 169 | } |
| 170 | |
| 171 | func Example() { |
| 172 | // This example creates a Graph that multiplies a constant matrix with |
| 173 | // a matrix to be provided during graph execution (via |
| 174 | // tensorflow.Session). |
| 175 | s := NewScope() |
| 176 | input := Placeholder(s, tf.Float) // Matrix to be provided to Session.Run |
| 177 | output := MatMul(s, |
| 178 | Const(s, [][]float32{{10}, {20}}), // Constant 2x1 matrix |
| 179 | input, |
| 180 | MatMulTransposeB(true)) |
| 181 | if s.Err() != nil { |
| 182 | panic(s.Err()) |
| 183 | } |
| 184 | // Shape of the product: The number of rows is fixed by m1, but the |
| 185 | // number of columns will depend on m2, which is unknown. |
| 186 | fmt.Println(output.Shape()) |
| 187 | // Output: [2, ?] |
| 188 | } |
| 189 | |
| 190 | func ExampleScope_SubScope() { |
| 191 | var ( |
nothing calls this directly
no test coverage detected