(t *testing.T)
| 54 | } |
| 55 | |
| 56 | func 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 | |
| 86 | func TestOperationShapeAttribute(t *testing.T) { |
| 87 | g := NewGraph() |
nothing calls this directly
no test coverage detected