/
onnx_test_maxunpool_export_with_output_shape.go
63 lines (50 loc) · 2.88 KB
/
onnx_test_maxunpool_export_with_output_shape.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
package onnxtest
// this file is auto-generated... DO NOT EDIT
import (
"github.com/owulveryck/onnx-go/backend/testbackend"
"gorgonia.org/tensor"
)
func init() {
testbackend.Register("MaxUnpool", "TestMaxunpoolExportWithOutputShape", NewTestMaxunpoolExportWithOutputShape)
}
// NewTestMaxunpoolExportWithOutputShape version: 3.
func NewTestMaxunpoolExportWithOutputShape() *testbackend.TestCase {
return &testbackend.TestCase{
OpType: "MaxUnpool",
Title: "TestMaxunpoolExportWithOutputShape",
ModelB: []byte{0x8, 0x3, 0x12, 0xc, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2d, 0x74, 0x65, 0x73, 0x74, 0x3a, 0xed, 0x1, 0xa, 0x4d, 0xa, 0x2, 0x78, 0x54, 0xa, 0x2, 0x78, 0x49, 0xa, 0xc, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x12, 0x1, 0x79, 0x22, 0x9, 0x4d, 0x61, 0x78, 0x55, 0x6e, 0x70, 0x6f, 0x6f, 0x6c, 0x2a, 0x15, 0xa, 0xc, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x40, 0x2, 0x40, 0x2, 0xa0, 0x1, 0x7, 0x2a, 0x10, 0xa, 0x7, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x73, 0x40, 0x2, 0x40, 0x2, 0xa0, 0x1, 0x7, 0x12, 0x27, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x61, 0x78, 0x75, 0x6e, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x5a, 0x1c, 0xa, 0x2, 0x78, 0x54, 0x12, 0x16, 0xa, 0x14, 0x8, 0x1, 0x12, 0x10, 0xa, 0x2, 0x8, 0x1, 0xa, 0x2, 0x8, 0x1, 0xa, 0x2, 0x8, 0x2, 0xa, 0x2, 0x8, 0x2, 0x5a, 0x1c, 0xa, 0x2, 0x78, 0x49, 0x12, 0x16, 0xa, 0x14, 0x8, 0x7, 0x12, 0x10, 0xa, 0x2, 0x8, 0x1, 0xa, 0x2, 0x8, 0x1, 0xa, 0x2, 0x8, 0x2, 0xa, 0x2, 0x8, 0x2, 0x5a, 0x1a, 0xa, 0xc, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65, 0x12, 0xa, 0xa, 0x8, 0x8, 0x7, 0x12, 0x4, 0xa, 0x2, 0x8, 0x4, 0x62, 0x1b, 0xa, 0x1, 0x79, 0x12, 0x16, 0xa, 0x14, 0x8, 0x1, 0x12, 0x10, 0xa, 0x2, 0x8, 0x1, 0xa, 0x2, 0x8, 0x1, 0xa, 0x2, 0x8, 0x5, 0xa, 0x2, 0x8, 0x5, 0x42, 0x2, 0x10, 0x9},
/*
&ir.NodeProto{
Input: []string{"xT", "xI", "output_shape"},
Output: []string{"y"},
Name: "",
OpType: "MaxUnpool",
Attributes: ([]*ir.AttributeProto) (len=2 cap=2) {
(*ir.AttributeProto)(0xc000132800)(name:"kernel_shape" type:INTS ints:2 ints:2 ),
(*ir.AttributeProto)(0xc000132900)(name:"strides" type:INTS ints:2 ints:2 )
}
,
},
*/
Input: []tensor.Tensor{
tensor.New(
tensor.WithShape(1, 1, 2, 2),
tensor.WithBacking([]float32{5, 6, 7, 8}),
),
tensor.New(
tensor.WithShape(1, 1, 2, 2),
tensor.WithBacking([]int64{5, 7, 13, 15}),
),
tensor.New(
tensor.WithShape(4),
tensor.WithBacking([]int64{1, 1, 5, 5}),
),
},
ExpectedOutput: []tensor.Tensor{
tensor.New(
tensor.WithShape(1, 1, 5, 5),
tensor.WithBacking([]float32{0, 0, 0, 0, 0, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, 0, 8, 0, 0, 0, 0, 0, 0}),
),
},
}
}