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

Function TestOperationOutputListSize

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

Source from the content-addressed store, hash-verified

54}
55
56func TestOperationOutputListSize(t *testing.T) {
57 graph := NewGraph()
58 c1, err := Const(graph, "c1", int64(1))
59 if err != nil {
60 t.Fatal(err)
61 }
62 c2, err := Const(graph, "c2", [][]int64{{1, 2}, {3, 4}})
63 if err != nil {
64 t.Fatal(err)
65 }
66 // The ShapeN op takes a list of tensors as input and a list as output.
67 op, err := graph.AddOperation(OpSpec{
68 Type: "ShapeN",
69 Input: []Input{OutputList{c1, c2}},
70 })
71 if err != nil {
72 t.Fatal(err)
73 }
74 n, err := op.OutputListSize("output")
75 if err != nil {
76 t.Fatal(err)
77 }
78 if got, want := n, 2; got != want {
79 t.Errorf("Got %d, want %d", got, want)
80 }
81 if got, want := op.NumOutputs(), 2; got != want {
82 t.Errorf("Got %d, want %d", got, want)
83 }
84}
85
86func TestOperationShapeAttribute(t *testing.T) {
87 g := NewGraph()

Callers

nothing calls this directly

Calls 6

AddOperationMethod · 0.95
NewGraphFunction · 0.85
int64Function · 0.85
OutputListSizeMethod · 0.80
ConstFunction · 0.50
NumOutputsMethod · 0.45

Tested by

no test coverage detected