Caffe2 - C++ API
A deep learning, cross platform ML framework
rank_loss_op.h
1 #pragma once
2 
3 #include "caffe2/core/context.h"
4 #include "caffe2/core/logging.h"
5 #include "caffe2/core/operator.h"
6 #include "caffe2/utils/math.h"
7 
8 namespace caffe2 {
9 
10 // support multiple batches of sessions
11 template <typename T, class Context>
12 class PairWiseLossOp final : public Operator<Context> {
13  public:
14  USE_SIMPLE_CTOR_DTOR(PairWiseLossOp);
15  USE_OPERATOR_CONTEXT_FUNCTIONS;
16  bool RunOnDevice() override;
17 
18  private:
19  INPUT_TAGS(XVALUE, LABEL, LENGTHS);
20  OUTPUT_TAGS(YVALUE);
21 };
22 
23 template <typename T, class Context>
24 class PairWiseLossGradientOp final : public Operator<Context> {
25  public:
26  USE_SIMPLE_CTOR_DTOR(PairWiseLossGradientOp);
27  USE_OPERATOR_CONTEXT_FUNCTIONS;
28  bool RunOnDevice() override;
29 
30  private:
31  INPUT_TAGS(XVALUE, LABEL, DYVALUE, LENGTHS);
32  OUTPUT_TAGS(DXVALUE);
33 };
34 
35 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13