1 #ifndef CAFFE2_UTILS_MATH_ELEMENTWISE_H_ 2 #define CAFFE2_UTILS_MATH_ELEMENTWISE_H_ 4 #include "caffe2/core/common.h" 5 #include "caffe2/core/types.h" 10 template <
typename T,
class Context>
11 CAFFE2_API
void Exp(
int N,
const T* X,
T* Y, Context* context);
12 template <
typename T,
class Context>
13 CAFFE2_API
void Log(
int N,
const T* X,
T* Y, Context* context);
14 template <
typename T,
class Context>
15 CAFFE2_API
void Sin(
int N,
const T* X,
T* Y, Context* context);
16 template <
typename T,
class Context>
17 CAFFE2_API
void Asin(
int N,
const T* X,
T* Y, Context* context);
18 template <
typename T,
class Context>
19 CAFFE2_API
void Cos(
int N,
const T* X,
T* Y, Context* context);
20 template <
typename T,
class Context>
21 CAFFE2_API
void Acos(
int N,
const T* X,
T* Y, Context* context);
22 template <
typename T,
class Context>
23 CAFFE2_API
void Tan(
int N,
const T* X,
T* Y, Context* context);
24 template <
typename T,
class Context>
25 CAFFE2_API
void Atan(
int N,
const T* X,
T* Y, Context* context);
26 template <
typename T,
class Context>
27 CAFFE2_API
void Sinh(
int N,
const T* X,
T* Y, Context* context);
28 template <
typename T,
class Context>
29 CAFFE2_API
void Cosh(
int N,
const T* X,
T* Y, Context* context);
30 template <
typename T,
class Context>
31 CAFFE2_API
void SinCos(
int N,
const T* X,
T* S,
T*
C, Context* context);
32 template <
typename T,
class Context>
33 CAFFE2_API
void Tanh(
int N,
const T* X,
T* Y, Context* context);
34 template <
typename T,
class Context>
35 CAFFE2_API
void Abs(
int N,
const T* X,
T* Y, Context* context);
36 template <
typename T,
class Context>
37 CAFFE2_API
void Sqr(
int N,
const T* X,
T* Y, Context* context);
38 template <
typename T,
class Context>
39 CAFFE2_API
void Sqrt(
int N,
const T* X,
T* Y, Context* context);
40 template <
typename T,
class Context>
41 CAFFE2_API
void Rsqrt(
int N,
const T* X,
T* Y, Context* context);
42 template <
typename T,
class Context>
43 CAFFE2_API
void Cube(
int N,
const T* X,
T* Y, Context* context);
44 template <
typename T,
class Context>
45 CAFFE2_API
void Cbrt(
int N,
const T* X,
T* Y, Context* context);
46 template <
typename T,
class Context>
47 CAFFE2_API
void Neg(
int N,
const T* X,
T* Y, Context* context);
48 template <
typename T,
class Context>
49 CAFFE2_API
void Sign(
int N,
const T* X,
T* Y, Context* context);
50 template <
typename T,
class Context>
51 CAFFE2_API
void Not(
int N,
const T* X,
T* Y, Context* context);
52 template <
typename T,
class Context>
53 CAFFE2_API
void Powx(
int N,
const T*
A,
const T b,
T* Y, Context* context);
54 template <
typename T,
class Context>
55 CAFFE2_API
void Inv(
int N,
const T* X,
T* Y, Context* context);
56 template <
typename T,
class Context>
57 CAFFE2_API
void Erf(
int N,
const T* X,
T* Y, Context* context);
59 template <
typename T,
class Context>
60 CAFFE2_API
void Set(std::int64_t N,
T alpha,
T* X, Context* context);
62 template <
typename TAlpha,
typename TData,
class Context>
64 Scale(
int N, TAlpha alpha,
const TData* X, TData* Y, Context* context);
68 template <
typename TAlpha,
typename TData,
class Context>
70 Scale(
int N,
const TAlpha* alpha,
const TData* X, TData* Y, Context* context);
72 template <
typename T,
class Context>
73 CAFFE2_API
void Add(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
74 template <
typename T,
class Context>
75 CAFFE2_API
void Sub(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
76 template <
typename T,
class Context>
77 CAFFE2_API
void Mul(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
78 template <
typename T,
class Context>
79 CAFFE2_API
void Div(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
81 template <
typename T,
class Context>
82 CAFFE2_API
void Min(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
83 template <
typename T,
class Context>
84 CAFFE2_API
void Max(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
86 template <
typename T,
class Context>
87 CAFFE2_API
void And(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
88 template <
typename T,
class Context>
89 CAFFE2_API
void Or(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
90 template <
typename T,
class Context>
91 CAFFE2_API
void Xor(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
93 template <
typename T,
class Context>
95 BitwiseAnd(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
96 template <
typename T,
class Context>
98 BitwiseOr(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
99 template <
typename T,
class Context>
101 BitwiseXor(
int N,
const T*
A,
const T*
B,
T*
C, Context* context);
103 template <
typename T,
class Context>
104 CAFFE2_API
void EQ(
int N,
const T*
A,
const T*
B,
bool*
C, Context* context);
105 template <
typename T,
class Context>
106 CAFFE2_API
void NE(
int N,
const T*
A,
const T*
B,
bool*
C, Context* context);
107 template <
typename T,
class Context>
108 CAFFE2_API
void LT(
int N,
const T*
A,
const T*
B,
bool*
C, Context* context);
109 template <
typename T,
class Context>
110 CAFFE2_API
void LE(
int N,
const T*
A,
const T*
B,
bool*
C, Context* context);
111 template <
typename T,
class Context>
112 CAFFE2_API
void GT(
int N,
const T*
A,
const T*
B,
bool*
C, Context* context);
113 template <
typename T,
class Context>
114 CAFFE2_API
void GE(
int N,
const T*
A,
const T*
B,
bool*
C, Context* context);
119 #endif // CAFFE2_UTILS_MATH_ELEMENTWISE_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...