Caffe2 - C++ API
A deep learning, cross platform ML framework
no_default_engine_op.h
1 
17 #ifndef CAFFE2_OPERATORS_NO_DEFAULT_ENGINE_OP_H_
18 #define CAFFE2_OPERATORS_NO_DEFAULT_ENGINE_OP_H_
19 
20 #include "caffe2/core/context.h"
21 #include "caffe2/core/logging.h"
22 #include "caffe2/core/operator.h"
23 
24 namespace caffe2 {
25 
34 template <class Context>
35 class NoDefaultEngineOp final : public Operator<Context> {
36  public:
37  USE_SIMPLE_CTOR_DTOR(NoDefaultEngineOp);
38  USE_OPERATOR_CONTEXT_FUNCTIONS;
39 
40  bool RunOnDevice() override {
41  CAFFE_THROW(
42  "The operator ",
43  this->debug_def().type(),
44  " does not have a default engine implementation. Please "
45  "specify an engine explicitly for this operator.");
46  }
47 };
48 
49 } // namespace caffe2
50 
51 #endif // CAFFE2_OPERATORS_NO_DEFAULT_ENGINE_OP_H_
Copyright (c) 2016-present, Facebook, Inc.
A helper class to denote that an op does not have a default engine.