/
onnx_test_neg.go
50 lines (39 loc) · 2.72 KB
/
onnx_test_neg.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
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("Neg", "TestNeg", NewTestNeg)
}
// NewTestNeg version: 3.
func NewTestNeg() *testbackend.TestCase {
return &testbackend.TestCase{
OpType: "Neg",
Title: "TestNeg",
ModelB: []byte{0x8, 0x3, 0x12, 0xc, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2d, 0x74, 0x65, 0x73, 0x74, 0x3a, 0x49, 0xa, 0xb, 0xa, 0x1, 0x78, 0x12, 0x1, 0x79, 0x22, 0x3, 0x4e, 0x65, 0x67, 0x12, 0x8, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x65, 0x67, 0x5a, 0x17, 0xa, 0x1, 0x78, 0x12, 0x12, 0xa, 0x10, 0x8, 0x1, 0x12, 0xc, 0xa, 0x2, 0x8, 0x3, 0xa, 0x2, 0x8, 0x4, 0xa, 0x2, 0x8, 0x5, 0x62, 0x17, 0xa, 0x1, 0x79, 0x12, 0x12, 0xa, 0x10, 0x8, 0x1, 0x12, 0xc, 0xa, 0x2, 0x8, 0x3, 0xa, 0x2, 0x8, 0x4, 0xa, 0x2, 0x8, 0x5, 0x42, 0x2, 0x10, 0x9},
/*
&ir.NodeProto{
Input: []string{"x"},
Output: []string{"y"},
Name: "",
OpType: "Neg",
Attributes: ([]*ir.AttributeProto) <nil>
,
},
*/
Input: []tensor.Tensor{
tensor.New(
tensor.WithShape(3, 4, 5),
tensor.WithBacking([]float32{1.7640524, 0.4001572, 0.978738, 2.2408931, 1.867558, -0.9772779, 0.95008844, -0.1513572, -0.10321885, 0.41059852, 0.14404356, 1.4542735, 0.7610377, 0.121675014, 0.44386324, 0.33367434, 1.4940791, -0.20515826, 0.3130677, -0.85409576, -2.5529897, 0.6536186, 0.8644362, -0.742165, 2.2697546, -1.4543657, 0.045758516, -0.18718386, 1.5327792, 1.4693588, 0.15494743, 0.37816253, -0.88778573, -1.9807965, -0.34791216, 0.15634897, 1.2302907, 1.2023798, -0.3873268, -0.30230275, -1.048553, -1.420018, -1.7062702, 1.9507754, -0.5096522, -0.4380743, -1.2527953, 0.7774904, -1.6138978, -0.21274029, -0.89546657, 0.3869025, -0.51080513, -1.1806322, -0.028182229, 0.42833188, 0.06651722, 0.3024719, -0.6343221, -0.36274117}),
),
},
ExpectedOutput: []tensor.Tensor{
tensor.New(
tensor.WithShape(3, 4, 5),
tensor.WithBacking([]float32{-1.7640524, -0.4001572, -0.978738, -2.2408931, -1.867558, 0.9772779, -0.95008844, 0.1513572, 0.10321885, -0.41059852, -0.14404356, -1.4542735, -0.7610377, -0.121675014, -0.44386324, -0.33367434, -1.4940791, 0.20515826, -0.3130677, 0.85409576, 2.5529897, -0.6536186, -0.8644362, 0.742165, -2.2697546, 1.4543657, -0.045758516, 0.18718386, -1.5327792, -1.4693588, -0.15494743, -0.37816253, 0.88778573, 1.9807965, 0.34791216, -0.15634897, -1.2302907, -1.2023798, 0.3873268, 0.30230275, 1.048553, 1.420018, 1.7062702, -1.9507754, 0.5096522, 0.4380743, 1.2527953, -0.7774904, 1.6138978, 0.21274029, 0.89546657, -0.3869025, 0.51080513, 1.1806322, 0.028182229, -0.42833188, -0.06651722, -0.3024719, 0.6343221, 0.36274117}),
),
},
}
}