Caffe2 - C++ API
A deep learning, cross platform ML framework
order_switch_ops.h
1 
17 #ifndef CAFFE2_OPERATORS_ORDER_SWITCH_OPS_H_
18 #define CAFFE2_OPERATORS_ORDER_SWITCH_OPS_H_
19 
20 #include "caffe2/core/operator.h"
21 
22 namespace caffe2 {
23 
24 // Note(Yangqing): I think it is possible to do a more general swapaxes operator
25 // but I am a little afraid of going down that general path. Only implementing
26 // the two actually needed ones here.
27 
28 template <typename T, class Context>
29 class NHWC2NCHWOp final : public Operator<Context> {
30  public:
31  USE_SIMPLE_CTOR_DTOR(NHWC2NCHWOp);
32  USE_OPERATOR_CONTEXT_FUNCTIONS;
33  bool RunOnDevice() override;
34 
35  protected:
36 };
37 
38 template <typename T, class Context>
39 class NCHW2NHWCOp final : public Operator<Context> {
40  public:
41  USE_SIMPLE_CTOR_DTOR(NCHW2NHWCOp);
42  USE_OPERATOR_CONTEXT_FUNCTIONS;
43  bool RunOnDevice() override;
44 
45  protected:
46 };
47 
48 } // namespace caffe2
49 
50 #endif // CAFFE2_OPERATORS_ORDER_SWITCH_OPS_H_
Copyright (c) 2016-present, Facebook, Inc.