-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
api_unary.go
140 lines (123 loc) · 3.33 KB
/
api_unary.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// Code generated by genlib2. DO NOT EDIT.
package tensor
import "github.com/pkg/errors"
func Neg(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if neger, ok := e.(Neger); ok {
return neger.Neg(a, opts...)
}
err = errors.Errorf("Engine does not perform Neg")
return
}
func Inv(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if inver, ok := e.(Inver); ok {
return inver.Inv(a, opts...)
}
err = errors.Errorf("Engine does not perform Inv")
return
}
func Square(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if squarer, ok := e.(Squarer); ok {
return squarer.Square(a, opts...)
}
err = errors.Errorf("Engine does not perform Square")
return
}
func Cube(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if cuber, ok := e.(Cuber); ok {
return cuber.Cube(a, opts...)
}
err = errors.Errorf("Engine does not perform Cube")
return
}
func Exp(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if exper, ok := e.(Exper); ok {
return exper.Exp(a, opts...)
}
err = errors.Errorf("Engine does not perform Exp")
return
}
func Tanh(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if tanher, ok := e.(Tanher); ok {
return tanher.Tanh(a, opts...)
}
err = errors.Errorf("Engine does not perform Tanh")
return
}
func Log(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if loger, ok := e.(Loger); ok {
return loger.Log(a, opts...)
}
err = errors.Errorf("Engine does not perform Log")
return
}
func Log2(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if log2er, ok := e.(Log2er); ok {
return log2er.Log2(a, opts...)
}
err = errors.Errorf("Engine does not perform Log2")
return
}
func Log10(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if log10er, ok := e.(Log10er); ok {
return log10er.Log10(a, opts...)
}
err = errors.Errorf("Engine does not perform Log10")
return
}
func Sqrt(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if sqrter, ok := e.(Sqrter); ok {
return sqrter.Sqrt(a, opts...)
}
err = errors.Errorf("Engine does not perform Sqrt")
return
}
func Cbrt(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if cbrter, ok := e.(Cbrter); ok {
return cbrter.Cbrt(a, opts...)
}
err = errors.Errorf("Engine does not perform Cbrt")
return
}
func InvSqrt(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if invsqrter, ok := e.(InvSqrter); ok {
return invsqrter.InvSqrt(a, opts...)
}
err = errors.Errorf("Engine does not perform InvSqrt")
return
}
func Abs(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if abser, ok := e.(Abser); ok {
return abser.Abs(a, opts...)
}
err = errors.Errorf("Engine does not perform Abs")
return
}
func Sign(a Tensor, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if signer, ok := e.(Signer); ok {
return signer.Sign(a, opts...)
}
err = errors.Errorf("Engine does not perform Sign")
return
}
func Clamp(a Tensor, min interface{}, max interface{}, opts ...FuncOpt) (retVal Tensor, err error) {
e := a.Engine()
if clamper, ok := e.(Clamper); ok {
return clamper.Clamp(a, min, max, opts...)
}
err = errors.Errorf("Engine does not perform Clamp")
return
}