MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Example

Function Example

tensorflow/go/op/scope_test.go:171–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

169}
170
171func 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
190func ExampleScope_SubScope() {
191 var (

Callers

nothing calls this directly

Calls 7

ErrMethod · 0.95
NewScopeFunction · 0.85
MatMulTransposeBFunction · 0.85
PlaceholderFunction · 0.70
MatMulFunction · 0.70
ConstFunction · 0.70
ShapeMethod · 0.45

Tested by

no test coverage detected