This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvalue_test.go
72 lines (69 loc) · 2.14 KB
/
value_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package gorgonnx
import (
"testing"
onnx "github.com/owulveryck/onnx-go"
)
func TestNewValue(t *testing.T) {
valueName := "MyInput"
dataType := onnx.TensorProto_FLOAT
testValue := &onnx.ValueInfoProto{
Name: &valueName,
Type: &onnx.TypeProto{
Value: &onnx.TypeProto_TensorType{
TensorType: &onnx.TypeProto_Tensor{
ElemType: &dataType,
Shape: &onnx.TensorShapeProto{
Dim: []*onnx.TensorShapeProto_Dimension{
&onnx.TensorShapeProto_Dimension{
Value: &onnx.TensorShapeProto_Dimension_DimValue{DimValue: 1},
Denotation: (*string)(nil),
XXX_NoUnkeyedLiteral: struct{}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
&onnx.TensorShapeProto_Dimension{
Value: &onnx.TensorShapeProto_Dimension_DimValue{DimValue: 2},
Denotation: (*string)(nil),
XXX_NoUnkeyedLiteral: struct{}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
&onnx.TensorShapeProto_Dimension{
Value: &onnx.TensorShapeProto_Dimension_DimValue{DimValue: 3},
Denotation: (*string)(nil),
XXX_NoUnkeyedLiteral: struct{}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
&onnx.TensorShapeProto_Dimension{
Value: &onnx.TensorShapeProto_Dimension_DimValue{DimValue: 4},
Denotation: (*string)(nil),
XXX_NoUnkeyedLiteral: struct{}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
},
XXX_NoUnkeyedLiteral: struct{}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct{}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
},
Denotation: (*string)(nil),
XXX_NoUnkeyedLiteral: struct{}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
DocString: (*string)(nil),
XXX_NoUnkeyedLiteral: struct{}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
_, err := NewValue(testValue)
if err != nil {
t.Fatal(err)
}
}