5 #include "caffe2/core/context.h" 6 #include "caffe2/core/logging.h" 7 #include "caffe2/core/operator.h" 8 #include "caffe2/utils/math.h" 12 template <
typename T,
class Context>
15 template <
class... Args>
19 this->
template GetSingleArgument<bool>(
"use_ndcg_as_loss",
false)),
21 this->
template GetSingleArgument<bool>(
"use_exp_gain",
true)) {}
22 USE_OPERATOR_CONTEXT_FUNCTIONS;
23 bool RunOnDevice()
override;
26 INPUT_TAGS(PRED, REL, SESSION_LENS);
27 OUTPUT_TAGS(LOSS, DPRED);
29 void ResizeInvLogITensor(
int);
30 void ComputeDiscounts(
int*,
int);
31 float LambdaRankNdcgSession(
37 bool use_ndcg_as_loss_;
47 template <
typename T,
class Context>
51 USE_OPERATOR_CONTEXT_FUNCTIONS;
52 bool RunOnDevice()
override;
55 INPUT_TAGS(Y, SESSION_LENS, DY_CACHE, DLOSS);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...