1 #ifndef CAFFE2_OPERATORS_CROSS_ENTROPY_OP_H_ 2 #define CAFFE2_OPERATORS_CROSS_ENTROPY_OP_H_ 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/logging.h" 6 #include "caffe2/core/operator.h" 7 #include "caffe2/utils/math.h" 11 template <
typename T,
class Context>
15 USE_OPERATOR_CONTEXT_FUNCTIONS;
16 bool RunOnDevice()
override;
19 static constexpr T kLOG_THRESHOLD() {
20 return static_cast<T
>(1e-20);
26 template <
typename T,
class Context>
30 USE_OPERATOR_CONTEXT_FUNCTIONS;
31 bool RunOnDevice()
override;
36 static constexpr T kLOG_THRESHOLD() {
37 return static_cast<T
>(1e-20);
43 template <
typename T,
class Context>
47 USE_OPERATOR_CONTEXT_FUNCTIONS;
48 bool RunOnDevice()
override;
55 template <
typename T,
class Context>
59 USE_OPERATOR_CONTEXT_FUNCTIONS;
60 bool RunOnDevice()
override;
67 template <
typename T,
class Context>
71 USE_OPERATOR_CONTEXT_FUNCTIONS;
72 bool RunOnDevice()
override;
75 template <
typename T,
class Context>
79 USE_OPERATOR_CONTEXT_FUNCTIONS;
80 bool RunOnDevice()
override;
83 template <
typename T,
class Context>
87 USE_OPERATOR_CONTEXT_FUNCTIONS;
88 bool RunOnDevice()
override;
91 template <
typename T,
class Context>
96 USE_OPERATOR_CONTEXT_FUNCTIONS;
97 bool RunOnDevice()
override;
100 template <
typename T,
class Context>
104 USE_OPERATOR_CONTEXT_FUNCTIONS;
105 bool RunOnDevice()
override;
110 static constexpr T kLOG_THRESHOLD() {
111 return static_cast<T
>(1e-20);
115 template <
typename T,
class Context>
119 USE_OPERATOR_CONTEXT_FUNCTIONS;
120 bool RunOnDevice()
override;
125 static constexpr T kLOG_THRESHOLD() {
126 return static_cast<T
>(1e-20);
132 #endif // CAFFE2_OPERATORS_CROSS_ENTROPY_OP_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...