/
onnx_test_scatter_with_axis.go
62 lines (49 loc) · 2.28 KB
/
onnx_test_scatter_with_axis.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
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("Scatter", "TestScatterWithAxis", NewTestScatterWithAxis)
}
// NewTestScatterWithAxis version: 3.
func NewTestScatterWithAxis() *testbackend.TestCase {
return &testbackend.TestCase{
OpType: "Scatter",
Title: "TestScatterWithAxis",
ModelB: []byte{0x8, 0x3, 0x12, 0xc, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2d, 0x74, 0x65, 0x73, 0x74, 0x3a, 0xae, 0x1, 0xa, 0x31, 0xa, 0x4, 0x64, 0x61, 0x74, 0x61, 0xa, 0x7, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0xa, 0x7, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x1, 0x79, 0x22, 0x7, 0x53, 0x63, 0x61, 0x74, 0x74, 0x65, 0x72, 0x2a, 0xb, 0xa, 0x4, 0x61, 0x78, 0x69, 0x73, 0x18, 0x1, 0xa0, 0x1, 0x2, 0x12, 0x16, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x63, 0x61, 0x74, 0x74, 0x65, 0x72, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x61, 0x78, 0x69, 0x73, 0x5a, 0x16, 0xa, 0x4, 0x64, 0x61, 0x74, 0x61, 0x12, 0xe, 0xa, 0xc, 0x8, 0x1, 0x12, 0x8, 0xa, 0x2, 0x8, 0x1, 0xa, 0x2, 0x8, 0x5, 0x5a, 0x19, 0xa, 0x7, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x12, 0xe, 0xa, 0xc, 0x8, 0x7, 0x12, 0x8, 0xa, 0x2, 0x8, 0x1, 0xa, 0x2, 0x8, 0x2, 0x5a, 0x19, 0xa, 0x7, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0xe, 0xa, 0xc, 0x8, 0x1, 0x12, 0x8, 0xa, 0x2, 0x8, 0x1, 0xa, 0x2, 0x8, 0x2, 0x62, 0x13, 0xa, 0x1, 0x79, 0x12, 0xe, 0xa, 0xc, 0x8, 0x1, 0x12, 0x8, 0xa, 0x2, 0x8, 0x1, 0xa, 0x2, 0x8, 0x5, 0x42, 0x2, 0x10, 0x9},
/*
&ir.NodeProto{
Input: []string{"data", "indices", "updates"},
Output: []string{"y"},
Name: "",
OpType: "Scatter",
Attributes: ([]*ir.AttributeProto) (len=1 cap=1) {
(*ir.AttributeProto)(0xc000126500)(name:"axis" type:INT i:1 )
}
,
},
*/
Input: []tensor.Tensor{
tensor.New(
tensor.WithShape(1, 5),
tensor.WithBacking([]float32{1, 2, 3, 4, 5}),
),
tensor.New(
tensor.WithShape(1, 2),
tensor.WithBacking([]int64{1, 3}),
),
tensor.New(
tensor.WithShape(1, 2),
tensor.WithBacking([]float32{1.1, 2.1}),
),
},
ExpectedOutput: []tensor.Tensor{
tensor.New(
tensor.WithShape(1, 5),
tensor.WithBacking([]float32{1, 1.1, 3, 2.1, 5}),
),
},
}
}