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

Function TestOperationInputs

tensorflow/go/operation_test.go:169–188  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

167}
168
169func TestOperationInputs(t *testing.T) {
170 g := NewGraph()
171 x, err := Placeholder(g, "x", Float)
172 if err != nil {
173 t.Fatal(err)
174 }
175 y, err := Placeholder(g, "y", Float)
176 if err != nil {
177 t.Fatal(err)
178 }
179 add, err := Add(g, "add", x, y)
180 if err != nil {
181 t.Fatal(err)
182 }
183 addOp := add.Op
184
185 if out := addOp.NumInputs(); out != 2 {
186 t.Fatalf("Got %d inputs, wanted 2", out)
187 }
188}
189
190func TestOperationConsumers(t *testing.T) {
191 g := NewGraph()

Callers

nothing calls this directly

Calls 4

NewGraphFunction · 0.85
PlaceholderFunction · 0.70
AddFunction · 0.70
NumInputsMethod · 0.45

Tested by

no test coverage detected