From 9b13b6f6774b21cddf6f914a618611e2200993b8 Mon Sep 17 00:00:00 2001 From: Chen Xin Date: Wed, 14 Sep 2022 15:20:57 +0800 Subject: [PATCH] Replace name direct_map_op with builtin_op Signed-off-by: Chen Xin --- BUILD | 8 +++--- .../tim/vx/{direct_map_op.h => builtin_op.h} | 10 +++---- include/tim/vx/ops/activations.h | 20 +++++++------- include/tim/vx/ops/addn.h | 4 +-- include/tim/vx/ops/arg.h | 4 +-- include/tim/vx/ops/batch2space.h | 4 +-- include/tim/vx/ops/batchnorm.h | 4 +-- include/tim/vx/ops/broadcast.h | 4 +-- include/tim/vx/ops/clip.h | 4 +-- include/tim/vx/ops/concat.h | 4 +-- include/tim/vx/ops/conv1d.h | 4 +-- include/tim/vx/ops/conv2d.h | 4 +-- include/tim/vx/ops/conv3d.h | 4 +-- include/tim/vx/ops/custom_base.h | 2 +- include/tim/vx/ops/deconv.h | 4 +-- include/tim/vx/ops/deconv1d.h | 4 +-- include/tim/vx/ops/depth2space.h | 4 +-- include/tim/vx/ops/dropout.h | 4 +-- include/tim/vx/ops/elementwise.h | 8 +++--- include/tim/vx/ops/erf.h | 4 +-- include/tim/vx/ops/fullyconnected.h | 4 +-- include/tim/vx/ops/gather.h | 4 +-- include/tim/vx/ops/gather_elements.h | 4 +-- include/tim/vx/ops/gathernd.h | 4 +-- include/tim/vx/ops/groupedconv1d.h | 4 +-- include/tim/vx/ops/groupedconv2d.h | 4 +-- include/tim/vx/ops/grucell.h | 4 +-- include/tim/vx/ops/instancenormalization.h | 4 +-- include/tim/vx/ops/l2normalization.h | 4 +-- include/tim/vx/ops/layernormalization.h | 4 +-- .../tim/vx/ops/localresponsenormalization.h | 4 +-- include/tim/vx/ops/logical.h | 4 +-- include/tim/vx/ops/logsoftmax.h | 4 +-- include/tim/vx/ops/matmul.h | 4 +-- include/tim/vx/ops/maxpoolwithargmax.h | 4 +-- include/tim/vx/ops/maxpoolwithargmax2.h | 4 +-- include/tim/vx/ops/maxunpool2d.h | 4 +-- include/tim/vx/ops/moments.h | 4 +-- include/tim/vx/ops/nbg.h | 4 +-- include/tim/vx/ops/onehot.h | 4 +-- include/tim/vx/ops/pad.h | 4 +-- include/tim/vx/ops/pool2d.h | 4 +-- include/tim/vx/ops/reduce.h | 4 +-- include/tim/vx/ops/relational_operations.h | 4 +-- include/tim/vx/ops/reorg.h | 4 +-- include/tim/vx/ops/reshape.h | 2 +- include/tim/vx/ops/resize.h | 4 +-- include/tim/vx/ops/resize1d.h | 4 +-- include/tim/vx/ops/reverse.h | 4 +-- include/tim/vx/ops/roi_align.h | 4 +-- include/tim/vx/ops/roi_pool.h | 4 +-- include/tim/vx/ops/scatternd.h | 4 +-- include/tim/vx/ops/select.h | 4 +-- include/tim/vx/ops/shuffle_channel.h | 4 +-- include/tim/vx/ops/signal_frame.h | 4 +-- include/tim/vx/ops/simple_operations.h | 4 +-- include/tim/vx/ops/slice.h | 4 +-- include/tim/vx/ops/softmax.h | 4 +-- include/tim/vx/ops/space2batch.h | 4 +-- include/tim/vx/ops/space2depth.h | 4 +-- include/tim/vx/ops/spatial_transformer.h | 4 +-- include/tim/vx/ops/split.h | 4 +-- include/tim/vx/ops/squeeze.h | 4 +-- include/tim/vx/ops/stack.h | 4 +-- include/tim/vx/ops/stridedslice.h | 4 +-- include/tim/vx/ops/svdf.h | 4 +-- include/tim/vx/ops/tile.h | 4 +-- include/tim/vx/ops/topk.h | 4 +-- include/tim/vx/ops/transpose.h | 4 +-- .../tim/vx/ops/unidirectional_sequence_gru.h | 4 +-- .../tim/vx/ops/unidirectional_sequence_lstm.h | 4 +-- include/tim/vx/ops/unstack.h | 4 +-- .../ops/activation_layout_inference.h | 2 +- src/tim/transform/ops/addn_layout_inference.h | 2 +- src/tim/transform/ops/arg_layout_inference.h | 2 +- .../ops/batch2space_layout_inference.h | 2 +- .../ops/broadcast_layout_inference.h | 2 +- .../transform/ops/concat_layout_inferene.h | 2 +- .../transform/ops/conv2d_layout_inference.h | 2 +- .../transform/ops/deconv2d_layout_inference.h | 2 +- .../transform/ops/default_layout_inference.h | 2 +- .../ops/depth2space_layout_inference.h | 2 +- .../ops/elementwise_layout_inference.h | 2 +- .../ops/fullyconnected_layout_inference.h | 2 +- .../transform/ops/gather_layout_inference.h | 2 +- .../ops/gather_nd_layout_inference.h | 2 +- .../ops/grouped_conv2d_layout_inference.h | 2 +- .../ops/l2normalization_layout_inference.h | 2 +- .../transform/ops/logical_layout_inference.h | 2 +- src/tim/transform/ops/lrn_layout_inference.h | 2 +- src/tim/transform/ops/op_layout_inference.cc | 2 +- src/tim/transform/ops/pad_layout_inference.h | 2 +- .../transform/ops/pool2d_layout_inference.h | 2 +- .../transform/ops/reduce_layout_inference.h | 2 +- .../transform/ops/resize_layout_inference.h | 2 +- .../transform/ops/reverse_layout_inference.h | 2 +- .../transform/ops/select_layout_inference.h | 2 +- .../ops/simple_ops_layout_inference.h | 2 +- .../transform/ops/slice_layout_inference.h | 2 +- .../transform/ops/softmax_layout_inference.h | 2 +- .../ops/space2batch_layout_inference.h | 2 +- .../ops/space2depth_layout_inference.h | 2 +- .../transform/ops/split_layout_inference.h | 2 +- .../transform/ops/squeeze_layout_inference.h | 2 +- .../transform/ops/stack_layout_inference.h | 2 +- .../ops/stridedslice_layout_inference.h | 2 +- .../ops/transpose_layout_inference.h | 2 +- .../unidirectional_lstm_layout_inference.h | 2 +- .../vx/{direct_map_op.cc => builtin_op.cc} | 8 +++--- ...rect_map_op_impl.cc => builtin_op_impl.cc} | 14 +++++----- ...direct_map_op_impl.h => builtin_op_impl.h} | 20 +++++++------- src/tim/vx/ops/activations.cc | 26 +++++++++---------- src/tim/vx/ops/addn.cc | 4 +-- src/tim/vx/ops/arg.cc | 4 +-- src/tim/vx/ops/batch2space.cc | 4 +-- src/tim/vx/ops/batchnorm.cc | 4 +-- src/tim/vx/ops/broadcast.cc | 4 +-- src/tim/vx/ops/clip.cc | 4 +-- src/tim/vx/ops/concat.cc | 4 +-- src/tim/vx/ops/conv1d.cc | 4 +-- src/tim/vx/ops/conv2d.cc | 4 +-- src/tim/vx/ops/conv3d.cc | 4 +-- src/tim/vx/ops/custom_base.cc | 2 +- src/tim/vx/ops/deconv.cc | 4 +-- src/tim/vx/ops/deconv1d.cc | 4 +-- src/tim/vx/ops/depth2space.cc | 4 +-- src/tim/vx/ops/dropout.cc | 4 +-- src/tim/vx/ops/elementwise.cc | 8 +++--- src/tim/vx/ops/erf.cc | 4 +-- src/tim/vx/ops/fullyconnected.cc | 4 +-- src/tim/vx/ops/gather.cc | 4 +-- src/tim/vx/ops/gather_elements.cc | 4 +-- src/tim/vx/ops/gathernd.cc | 4 +-- src/tim/vx/ops/groupedconv1d.cc | 4 +-- src/tim/vx/ops/groupedconv2d.cc | 6 ++--- src/tim/vx/ops/grucell.cc | 4 +-- src/tim/vx/ops/instancenormalization.cc | 4 +-- src/tim/vx/ops/l2normalization.cc | 4 +-- src/tim/vx/ops/layernormalization.cc | 4 +-- src/tim/vx/ops/localresponsenormalization.cc | 4 +-- src/tim/vx/ops/logical.cc | 4 +-- src/tim/vx/ops/logsoftmax.cc | 4 +-- src/tim/vx/ops/matmul.cc | 4 +-- src/tim/vx/ops/maxpoolwithargmax.cc | 4 +-- src/tim/vx/ops/maxpoolwithargmax2.cc | 4 +-- src/tim/vx/ops/maxunpool2d.cc | 4 +-- src/tim/vx/ops/mements.cc | 4 +-- src/tim/vx/ops/nbg.cc | 4 +-- src/tim/vx/ops/onehot.cc | 4 +-- src/tim/vx/ops/pad.cc | 4 +-- src/tim/vx/ops/pool2d.cc | 10 +++---- src/tim/vx/ops/reduce.cc | 4 +-- src/tim/vx/ops/relational_operations.cc | 4 +-- src/tim/vx/ops/reorg.cc | 4 +-- src/tim/vx/ops/reshape.cc | 6 ++--- src/tim/vx/ops/resize.cc | 4 +-- src/tim/vx/ops/resize1d.cc | 4 +-- src/tim/vx/ops/reverse.cc | 4 +-- src/tim/vx/ops/roi_align.cc | 4 +-- src/tim/vx/ops/roi_pool.cc | 4 +-- src/tim/vx/ops/scatternd.cc | 4 +-- src/tim/vx/ops/select.cc | 4 +-- src/tim/vx/ops/shuffle_channel.cc | 4 +-- src/tim/vx/ops/signal_frame.cc | 4 +-- src/tim/vx/ops/simple_operations.cc | 2 +- src/tim/vx/ops/slice.cc | 6 ++--- src/tim/vx/ops/softmax.cc | 4 +-- src/tim/vx/ops/space2batch.cc | 4 +-- src/tim/vx/ops/space2depth.cc | 4 +-- src/tim/vx/ops/spatial_transformer.cc | 4 +-- src/tim/vx/ops/split.cc | 4 +-- src/tim/vx/ops/squeeze.cc | 4 +-- src/tim/vx/ops/stack.cc | 4 +-- src/tim/vx/ops/stridedslice.cc | 4 +-- src/tim/vx/ops/svdf.cc | 4 +-- src/tim/vx/ops/tile.cc | 4 +-- src/tim/vx/ops/topk.cc | 4 +-- src/tim/vx/ops/transpose.cc | 4 +-- src/tim/vx/ops/unidirectional_sequence_gru.cc | 4 +-- .../vx/ops/unidirectional_sequence_lstm.cc | 4 +-- src/tim/vx/ops/unstack.cc | 4 +-- 181 files changed, 371 insertions(+), 371 deletions(-) rename include/tim/vx/{direct_map_op.h => builtin_op.h} (88%) rename src/tim/vx/{direct_map_op.cc => builtin_op.cc} (85%) rename src/tim/vx/{direct_map_op_impl.cc => builtin_op_impl.cc} (89%) rename src/tim/vx/{direct_map_op_impl.h => builtin_op_impl.h} (82%) diff --git a/BUILD b/BUILD index 40917ca..3c0bb42 100644 --- a/BUILD +++ b/BUILD @@ -28,7 +28,7 @@ cc_library( ], hdrs = [ "include/tim/vx/context.h", - "include/tim/vx/direct_map_op.h", + "include/tim/vx/builtin_op.h", "include/tim/vx/graph.h", "include/tim/vx/operation.h", "include/tim/vx/ops.h", @@ -45,9 +45,9 @@ cc_library( "src/tim/vx/compile_option.cc", "src/tim/vx/graph_private.h", "src/tim/vx/graph.cc", - "src/tim/vx/direct_map_op_impl.cc", - "src/tim/vx/direct_map_op.cc", - "src/tim/vx/direct_map_op_impl.h", + "src/tim/vx/builtin_op_impl.cc", + "src/tim/vx/builtin_op.cc", + "src/tim/vx/builtin_op_impl.h", "src/tim/vx/op_impl.cc", "src/tim/vx/op_impl.h", "src/tim/vx/operation.cc", diff --git a/include/tim/vx/direct_map_op.h b/include/tim/vx/builtin_op.h similarity index 88% rename from include/tim/vx/direct_map_op.h rename to include/tim/vx/builtin_op.h index 25092fb..0807b66 100644 --- a/include/tim/vx/direct_map_op.h +++ b/include/tim/vx/builtin_op.h @@ -21,17 +21,17 @@ * DEALINGS IN THE SOFTWARE. * *****************************************************************************/ -#ifndef TIM_VX_DIRECTMAPOP_H -#define TIM_VX_DIRECTMAPOP_H +#ifndef TIM_VX_BUILTIN_OP_H_ +#define TIM_VX_BUILTIN_OP_H_ #include "tim/vx/operation.h" - +#define DirectMapOp BuiltinOp namespace tim { namespace vx { // interface -class DirectMapOp : public Operation { +class BuiltinOp : public Operation { public: - DirectMapOp(Graph* graph, uint32_t kind, int in_cnt = 0, int out_cnt = 0, + BuiltinOp(Graph* graph, uint32_t kind, int in_cnt = 0, int out_cnt = 0, DataLayout layout = DataLayout::ANY); }; diff --git a/include/tim/vx/ops/activations.h b/include/tim/vx/ops/activations.h index 3e93300..629e54e 100644 --- a/include/tim/vx/ops/activations.h +++ b/include/tim/vx/ops/activations.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_ACTIVATIONS_H_ #define TIM_VX_OPS_ACTIVATIONS_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -73,7 +73,7 @@ namespace ops { */ #define DECLARE_NO_PARAMETER_ACTIVATION(NAME) \ - class NAME : public DirectMapOp { \ + class NAME : public BuiltinOp { \ public: \ NAME(Graph* graph); \ std::shared_ptr Clone( \ @@ -92,7 +92,7 @@ DECLARE_NO_PARAMETER_ACTIVATION(SoftRelu) #undef DEFINE_NO_PARAMETER_ACTIVATION -class Elu : public DirectMapOp { +class Elu : public BuiltinOp { public: Elu(Graph* graph); Elu(Graph* graph, float alpha); @@ -103,7 +103,7 @@ class Elu : public DirectMapOp { float alpha_; }; -class Prelu : public DirectMapOp { +class Prelu : public BuiltinOp { public: Prelu(Graph* graph, int axis); std::shared_ptr Clone( @@ -113,7 +113,7 @@ class Prelu : public DirectMapOp { int axis_; }; -class HardSigmoid : public DirectMapOp { +class HardSigmoid : public BuiltinOp { public: HardSigmoid(Graph* graph, float alpha, float beta); std::shared_ptr Clone( @@ -124,7 +124,7 @@ class HardSigmoid : public DirectMapOp { float beta_; }; -class LeakyRelu : public DirectMapOp { +class LeakyRelu : public BuiltinOp { public: LeakyRelu(Graph* graph, float alpha); std::shared_ptr Clone( @@ -134,7 +134,7 @@ class LeakyRelu : public DirectMapOp { float alpha_; }; -class Linear : public DirectMapOp { +class Linear : public BuiltinOp { public: Linear(Graph* graph, float a, float b = 0.0); std::shared_ptr Clone( @@ -145,7 +145,7 @@ class Linear : public DirectMapOp { float b_; }; -class Gelu : public DirectMapOp { +class Gelu : public BuiltinOp { public: /**************************************************************************** *Non-approximate calculations will also have errors when the data type is @@ -156,7 +156,7 @@ class Gelu : public DirectMapOp { std::shared_ptr& graph) const override; }; -class Selu : public DirectMapOp { +class Selu : public BuiltinOp { public: Selu(Graph* graph, float alpha = 1.67326, float gamma = 1.0507); @@ -168,7 +168,7 @@ class Selu : public DirectMapOp { float gamma_; }; -class Celu : public DirectMapOp { +class Celu : public BuiltinOp { public: Celu(Graph* graph, float alpha); diff --git a/include/tim/vx/ops/addn.h b/include/tim/vx/ops/addn.h index cd7a105..23e8752 100644 --- a/include/tim/vx/ops/addn.h +++ b/include/tim/vx/ops/addn.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_ADDN_H_ #define TIM_VX_OPS_ADDN_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -37,7 +37,7 @@ namespace ops { * ``` */ -class AddN : public DirectMapOp { +class AddN : public BuiltinOp { public: AddN(Graph* graph, uint32_t num_inputs); diff --git a/include/tim/vx/ops/arg.h b/include/tim/vx/ops/arg.h index 3f26cd0..05c1bef 100644 --- a/include/tim/vx/ops/arg.h +++ b/include/tim/vx/ops/arg.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_ARG_H_ #define TIM_VX_OPS_ARG_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -37,7 +37,7 @@ namespace ops { */ #define DECLARE_ARG_OP(NAME) \ - class Arg##NAME : public DirectMapOp { \ + class Arg##NAME : public BuiltinOp { \ public: \ Arg##NAME(Graph* graph, int32_t axis); \ std::shared_ptr Clone( \ diff --git a/include/tim/vx/ops/batch2space.h b/include/tim/vx/ops/batch2space.h index 809d1a7..6f73dec 100644 --- a/include/tim/vx/ops/batch2space.h +++ b/include/tim/vx/ops/batch2space.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -43,7 +43,7 @@ namespace ops { * - crop : corp the output tensor for ROI usage. */ -class Batch2Space : public DirectMapOp { +class Batch2Space : public BuiltinOp { public: Batch2Space(Graph* graph, const std::vector& block_size, const std::vector& crop, diff --git a/include/tim/vx/ops/batchnorm.h b/include/tim/vx/ops/batchnorm.h index 57015ce..9731621 100644 --- a/include/tim/vx/ops/batchnorm.h +++ b/include/tim/vx/ops/batchnorm.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef OVXLIBXX_OPERATIONS_BATCHNORM_H_ #define OVXLIBXX_OPERATIONS_BATCHNORM_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -40,7 +40,7 @@ namespace ops { * $$y_i=\gamma\hat x_i+\beta\equiv BN_{\gamma,\beta}(x_i)$$ */ -class BatchNorm : public DirectMapOp { +class BatchNorm : public BuiltinOp { public: BatchNorm(Graph* graph, float eps, DataLayout input_layout = DataLayout::WHCN); diff --git a/include/tim/vx/ops/broadcast.h b/include/tim/vx/ops/broadcast.h index c6e4a67..7e2329c 100644 --- a/include/tim/vx/ops/broadcast.h +++ b/include/tim/vx/ops/broadcast.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef OVXLIBXX_OPERATIONS_BROADCAST_H_ #define OVXLIBXX_OPERATIONS_BROADCAST_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -43,7 +43,7 @@ namespace ops { * of the operand shape corresponds to. For BroadcastInDim. */ -class Broadcast : public DirectMapOp { +class Broadcast : public BuiltinOp { public: Broadcast(Graph* graph, const std::vector& shape, const std::vector& dimensions = {}); diff --git a/include/tim/vx/ops/clip.h b/include/tim/vx/ops/clip.h index 6b0fda7..b807e9f 100644 --- a/include/tim/vx/ops/clip.h +++ b/include/tim/vx/ops/clip.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef OVXLIBXX_OPERATIONS_CLIP_H_ #define OVXLIBXX_OPERATIONS_CLIP_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { @@ -36,7 +36,7 @@ namespace ops { * Clip(x) : min if x <= min; x if min < x < max; max if x >= max */ -class Clip : public DirectMapOp { +class Clip : public BuiltinOp { public: Clip(Graph* graph, float min, float max); diff --git a/include/tim/vx/ops/concat.h b/include/tim/vx/ops/concat.h index eab629d..45bbb35 100644 --- a/include/tim/vx/ops/concat.h +++ b/include/tim/vx/ops/concat.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_CONCAT_H_ #define TIM_VX_OPS_CONCAT_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -37,7 +37,7 @@ namespace ops { * - axis : Which axis to concat on. */ -class Concat : public DirectMapOp { +class Concat : public BuiltinOp { public: Concat(Graph* graph, uint32_t axis, int input_cnt); diff --git a/include/tim/vx/ops/conv1d.h b/include/tim/vx/ops/conv1d.h index 4d15f7f..4c61bfd 100644 --- a/include/tim/vx/ops/conv1d.h +++ b/include/tim/vx/ops/conv1d.h @@ -26,13 +26,13 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { namespace ops { -class Conv1d : public DirectMapOp { +class Conv1d : public BuiltinOp { public: Conv1d(Graph* graph, PadType padding, uint32_t stride, uint32_t dilation, int32_t multiplier = 0, diff --git a/include/tim/vx/ops/conv2d.h b/include/tim/vx/ops/conv2d.h index 5e77ae3..c5634a2 100644 --- a/include/tim/vx/ops/conv2d.h +++ b/include/tim/vx/ops/conv2d.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -55,7 +55,7 @@ namespace ops { * - layout : WHCN or CWHN. */ -class Conv2d : public DirectMapOp { +class Conv2d : public BuiltinOp { public: Conv2d(Graph* graph, PadType padding, const std::array& stride, diff --git a/include/tim/vx/ops/conv3d.h b/include/tim/vx/ops/conv3d.h index c57b677..43d45c6 100644 --- a/include/tim/vx/ops/conv3d.h +++ b/include/tim/vx/ops/conv3d.h @@ -25,7 +25,7 @@ #define TIM_VX_OPS_CONV3D_H_ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -54,7 +54,7 @@ namespace ops { * - kernel_layout : WHDIcOc */ -class Conv3d : public DirectMapOp { +class Conv3d : public BuiltinOp { public: Conv3d(Graph* graph, PadType padding, const std::array& stride, diff --git a/include/tim/vx/ops/custom_base.h b/include/tim/vx/ops/custom_base.h index 1059924..5fc9a57 100644 --- a/include/tim/vx/ops/custom_base.h +++ b/include/tim/vx/ops/custom_base.h @@ -24,7 +24,7 @@ #ifndef TIM_VX_OPS_CUSTOM_BASE_H_ #define TIM_VX_OPS_CUSTOM_BASE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" #include #include diff --git a/include/tim/vx/ops/deconv.h b/include/tim/vx/ops/deconv.h index 86007e9..540ed29 100644 --- a/include/tim/vx/ops/deconv.h +++ b/include/tim/vx/ops/deconv.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -53,7 +53,7 @@ namespace ops { * - kernel_layout: Layout for kernel, WHIO by default. */ -class DeConv2d : public DirectMapOp { +class DeConv2d : public BuiltinOp { public: DeConv2d(Graph* graph, int32_t oc_count_, PadType pad_type, const std::array& ksize, diff --git a/include/tim/vx/ops/deconv1d.h b/include/tim/vx/ops/deconv1d.h index 206cec7..e754654 100644 --- a/include/tim/vx/ops/deconv1d.h +++ b/include/tim/vx/ops/deconv1d.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -49,7 +49,7 @@ namespace ops { * the output tensor. */ -class DeConv1d : public DirectMapOp { +class DeConv1d : public BuiltinOp { public: DeConv1d(Graph* graph, PadType pad_type, uint32_t stride, uint32_t output_padding, uint32_t group = 1, diff --git a/include/tim/vx/ops/depth2space.h b/include/tim/vx/ops/depth2space.h index 96753bc..ec1c522 100644 --- a/include/tim/vx/ops/depth2space.h +++ b/include/tim/vx/ops/depth2space.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_DEPTH2SPACE_H_ #define TIM_VX_OPS_DEPTH2SPACE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -45,7 +45,7 @@ namespace ops { * - crop : corp the output tensor for ROI usage. */ -class DepthToSpace : public DirectMapOp { +class DepthToSpace : public BuiltinOp { public: enum depth2space_mode { CRD_mode = 0, diff --git a/include/tim/vx/ops/dropout.h b/include/tim/vx/ops/dropout.h index a14b85c..7127b27 100644 --- a/include/tim/vx/ops/dropout.h +++ b/include/tim/vx/ops/dropout.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef OVXLIBXX_OPERATIONS_DROPOUT_H_ #define OVXLIBXX_OPERATIONS_DROPOUT_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { @@ -40,7 +40,7 @@ namespace ops { * for Dropout operator. */ -class Dropout : public DirectMapOp { +class Dropout : public BuiltinOp { public: Dropout(Graph* graph, float ratio); diff --git a/include/tim/vx/ops/elementwise.h b/include/tim/vx/ops/elementwise.h index 85d70b6..9562cd4 100644 --- a/include/tim/vx/ops/elementwise.h +++ b/include/tim/vx/ops/elementwise.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_ELEMENTWISE_H_ #define TIM_VX_OPS_ELEMENTWISE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -67,7 +67,7 @@ namespace ops { */ #define DECLARE_ELEMENTWISE_OP(NAME) \ - class NAME : public DirectMapOp { \ + class NAME : public BuiltinOp { \ public: \ NAME(Graph* graph); \ std::shared_ptr Clone( \ @@ -81,14 +81,14 @@ DECLARE_ELEMENTWISE_OP(Sub) DECLARE_ELEMENTWISE_OP(Pow) DECLARE_ELEMENTWISE_OP(FloorDiv) -class Multiply : public DirectMapOp { +class Multiply : public BuiltinOp { public: Multiply(Graph* graph, float scale = 1.0f); std::shared_ptr Clone(std::shared_ptr& graph) const override; }; -class Div : public DirectMapOp { +class Div : public BuiltinOp { public: Div(Graph* graph, float scale = 1.0f); diff --git a/include/tim/vx/ops/erf.h b/include/tim/vx/ops/erf.h index 0ecfa23..2299fe9 100644 --- a/include/tim/vx/ops/erf.h +++ b/include/tim/vx/ops/erf.h @@ -24,7 +24,7 @@ #ifndef TIM_VX_OPS_ERF_H_ #define TIM_VX_OPS_ERF_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" #include "tim/vx/types.h" namespace tim { @@ -39,7 +39,7 @@ namespace ops { * - no parameters */ -class Erf : public DirectMapOp { +class Erf : public BuiltinOp { public: Erf(Graph* graph); std::shared_ptr Clone(std::shared_ptr& graph) const override; diff --git a/include/tim/vx/ops/fullyconnected.h b/include/tim/vx/ops/fullyconnected.h index 7192bc5..6544938 100644 --- a/include/tim/vx/ops/fullyconnected.h +++ b/include/tim/vx/ops/fullyconnected.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_FULLYCONNECTED_H_ #define TIM_VX_OPS_FULLYCONNECTED_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -39,7 +39,7 @@ namespace ops { * - weights: the output channel number for weight tensor. */ -class FullyConnected : public DirectMapOp { +class FullyConnected : public BuiltinOp { public: FullyConnected(Graph* graph, uint32_t axis); FullyConnected(Graph* graph, uint32_t axis, uint32_t weights); diff --git a/include/tim/vx/ops/gather.h b/include/tim/vx/ops/gather.h index 704a9e0..01f0b51 100644 --- a/include/tim/vx/ops/gather.h +++ b/include/tim/vx/ops/gather.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_GATHER_H_ #define TIM_VX_OPS_GATHER_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -35,7 +35,7 @@ namespace ops { * Gather slices from input, **axis** according to **indices**. */ -class Gather : public DirectMapOp { +class Gather : public BuiltinOp { public: Gather(Graph* Graph, int axis, int batch_dims = 0); diff --git a/include/tim/vx/ops/gather_elements.h b/include/tim/vx/ops/gather_elements.h index 509e8d9..4d38fb7 100644 --- a/include/tim/vx/ops/gather_elements.h +++ b/include/tim/vx/ops/gather_elements.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_GATHER_ELEMENTS_H_ #define TIM_VX_OPS_GATHER_ELEMENTS_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -39,7 +39,7 @@ namespace ops { * https://github.com/onnx/onnx/blob/main/docs/Operators.md#GatherElements */ -class GatherElements : public DirectMapOp { +class GatherElements : public BuiltinOp { public: GatherElements(Graph* Graph, int axis); diff --git a/include/tim/vx/ops/gathernd.h b/include/tim/vx/ops/gathernd.h index 1d2e8e7..8dc46de 100644 --- a/include/tim/vx/ops/gathernd.h +++ b/include/tim/vx/ops/gathernd.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_GATHERND_H_ #define TIM_VX_OPS_GATHERND_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -35,7 +35,7 @@ namespace ops { * An operation similar to Gather but gathers across multiple axis at once. */ -class GatherNd : public DirectMapOp { +class GatherNd : public BuiltinOp { public: GatherNd(Graph* Graph); diff --git a/include/tim/vx/ops/groupedconv1d.h b/include/tim/vx/ops/groupedconv1d.h index 439291b..fbfe9da 100644 --- a/include/tim/vx/ops/groupedconv1d.h +++ b/include/tim/vx/ops/groupedconv1d.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -53,7 +53,7 @@ namespace ops { * - layout : WCN or CWN. */ -class GroupedConv1d : public DirectMapOp { +class GroupedConv1d : public BuiltinOp { public: GroupedConv1d(Graph* graph, PadType padding, std::array pad, uint32_t stride, uint32_t dilation, uint32_t group, diff --git a/include/tim/vx/ops/groupedconv2d.h b/include/tim/vx/ops/groupedconv2d.h index d888fe6..84e5956 100644 --- a/include/tim/vx/ops/groupedconv2d.h +++ b/include/tim/vx/ops/groupedconv2d.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -53,7 +53,7 @@ namespace ops { * - layout : WHCN or CWHN. */ -class GroupedConv2d : public DirectMapOp { +class GroupedConv2d : public BuiltinOp { public: GroupedConv2d(Graph* graph, PadType padding, const std::array& strides, diff --git a/include/tim/vx/ops/grucell.h b/include/tim/vx/ops/grucell.h index f6f2c56..5f935fa 100644 --- a/include/tim/vx/ops/grucell.h +++ b/include/tim/vx/ops/grucell.h @@ -25,7 +25,7 @@ #define TIM_VX_OPS_GRUCELL_H_ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" #include "vsi_nn_pub.h" namespace tim { @@ -42,7 +42,7 @@ namespace ops { * False = "before", True = "after". */ -class GRUCell : public DirectMapOp { +class GRUCell : public BuiltinOp { public: enum ActivationType { kNONE = 0, diff --git a/include/tim/vx/ops/instancenormalization.h b/include/tim/vx/ops/instancenormalization.h index 8764587..7c347d0 100644 --- a/include/tim/vx/ops/instancenormalization.h +++ b/include/tim/vx/ops/instancenormalization.h @@ -23,12 +23,12 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_INSTANCENOMALIZATION_H_ #define TIM_VX_OPS_INSTANCENOMALIZATION_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { namespace ops { -class InstanceNormalization : public DirectMapOp { +class InstanceNormalization : public BuiltinOp { public: InstanceNormalization(Graph* graph, float eps = 1e-5f); diff --git a/include/tim/vx/ops/l2normalization.h b/include/tim/vx/ops/l2normalization.h index 876483f..456e0d5 100644 --- a/include/tim/vx/ops/l2normalization.h +++ b/include/tim/vx/ops/l2normalization.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_L2NOMALIZATION_H_ #define TIM_VX_OPS_L2NOMALIZATION_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" /** * ## L2Normalization @@ -40,7 +40,7 @@ namespace tim { namespace vx { namespace ops { -class L2Normalization : public DirectMapOp { +class L2Normalization : public BuiltinOp { public: L2Normalization(Graph* graph, int32_t axis); diff --git a/include/tim/vx/ops/layernormalization.h b/include/tim/vx/ops/layernormalization.h index 34216a4..bc13707 100644 --- a/include/tim/vx/ops/layernormalization.h +++ b/include/tim/vx/ops/layernormalization.h @@ -25,12 +25,12 @@ #define TIM_VX_OPS_LAYERNOMALIZATION_H_ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { namespace ops { -class LayerNormalization : public DirectMapOp { +class LayerNormalization : public BuiltinOp { public: LayerNormalization(Graph* graph, int32_t axis = 0, float eps = 1e-5f); diff --git a/include/tim/vx/ops/localresponsenormalization.h b/include/tim/vx/ops/localresponsenormalization.h index b4f6b84..1362e6c 100644 --- a/include/tim/vx/ops/localresponsenormalization.h +++ b/include/tim/vx/ops/localresponsenormalization.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_LOCALRESPONSENORMALIZATION_H_ #define TIM_VX_OPS_LOCALRESPONSENORMALIZATION_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" /** * ## LocalResponseNormalization @@ -45,7 +45,7 @@ namespace tim { namespace vx { namespace ops { -class LocalResponseNormalization : public DirectMapOp { +class LocalResponseNormalization : public BuiltinOp { public: LocalResponseNormalization(Graph* graph, uint32_t size, float alpha, float beta, float bias, int32_t axis); diff --git a/include/tim/vx/ops/logical.h b/include/tim/vx/ops/logical.h index 369c7b5..1be6f4e 100644 --- a/include/tim/vx/ops/logical.h +++ b/include/tim/vx/ops/logical.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_LOGICAL_H_ #define TIM_VX_OPS_LOGICAL_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -40,7 +40,7 @@ namespace ops { */ #define DECLARE_LOGICAL_OP(NAME) \ - class Logical##NAME : public DirectMapOp { \ + class Logical##NAME : public BuiltinOp { \ public: \ Logical##NAME(Graph* graph); \ std::shared_ptr Clone( \ diff --git a/include/tim/vx/ops/logsoftmax.h b/include/tim/vx/ops/logsoftmax.h index 53fb94d..2550656 100644 --- a/include/tim/vx/ops/logsoftmax.h +++ b/include/tim/vx/ops/logsoftmax.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_LOG_SOFTMAX_H_ #define TIM_VX_OPS_LOG_SOFTMAX_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -39,7 +39,7 @@ namespace ops { * ``` */ -class LogSoftmax : public DirectMapOp { +class LogSoftmax : public BuiltinOp { public: LogSoftmax(Graph* graph, int32_t axis, float beta = 1.f); diff --git a/include/tim/vx/ops/matmul.h b/include/tim/vx/ops/matmul.h index a0c420e..fe99fc7 100644 --- a/include/tim/vx/ops/matmul.h +++ b/include/tim/vx/ops/matmul.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_MATMUL_H_ #define TIM_VX_OPS_MATMUL_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -40,7 +40,7 @@ namespace ops { * - adjoint_b: If True, b is conjugated and transposed before multiplication. */ -class Matmul : public DirectMapOp { +class Matmul : public BuiltinOp { public: Matmul(Graph* graph, bool transpose_a = false, bool transpose_b = false, bool adjoint_a = false, bool adjoint_b = false); diff --git a/include/tim/vx/ops/maxpoolwithargmax.h b/include/tim/vx/ops/maxpoolwithargmax.h index ca44ae5..98317b2 100644 --- a/include/tim/vx/ops/maxpoolwithargmax.h +++ b/include/tim/vx/ops/maxpoolwithargmax.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" #include "tim/vx/types.h" namespace tim { @@ -44,7 +44,7 @@ namespace ops { * - round_type : CEILING or FLOOR. */ -class MaxpoolWithArgmax : public DirectMapOp { +class MaxpoolWithArgmax : public BuiltinOp { public: MaxpoolWithArgmax(Graph* graph, PadType padding, const std::array& ksize, diff --git a/include/tim/vx/ops/maxpoolwithargmax2.h b/include/tim/vx/ops/maxpoolwithargmax2.h index 54e6b8c..bcb5345 100644 --- a/include/tim/vx/ops/maxpoolwithargmax2.h +++ b/include/tim/vx/ops/maxpoolwithargmax2.h @@ -27,7 +27,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" #include "tim/vx/types.h" namespace tim { @@ -45,7 +45,7 @@ namespace ops { * - round_type : CEILING or FLOOR. */ -class MaxpoolWithArgmax2 : public DirectMapOp { +class MaxpoolWithArgmax2 : public BuiltinOp { public: MaxpoolWithArgmax2(Graph* graph, PadType padding, const std::array& ksize, diff --git a/include/tim/vx/ops/maxunpool2d.h b/include/tim/vx/ops/maxunpool2d.h index 60ae4ee..dbd2dc4 100644 --- a/include/tim/vx/ops/maxunpool2d.h +++ b/include/tim/vx/ops/maxunpool2d.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" #include "tim/vx/types.h" namespace tim { @@ -42,7 +42,7 @@ namespace ops { * - ksize : filter size. */ -class MaxUnpool2d : public DirectMapOp { +class MaxUnpool2d : public BuiltinOp { public: MaxUnpool2d(Graph* graph, const std::array& ksize, const std::array& stride, DataLayout layout = DataLayout::WHCN); diff --git a/include/tim/vx/ops/moments.h b/include/tim/vx/ops/moments.h index b1fc39b..7c5202b 100644 --- a/include/tim/vx/ops/moments.h +++ b/include/tim/vx/ops/moments.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_MOMENTS_H_ #define TIM_VX_OPS_MOMENTS_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -39,7 +39,7 @@ namespace ops { * - keep_dims : Produce moments with the same dimensionality as input. */ -class Moments : public DirectMapOp { +class Moments : public BuiltinOp { public: Moments(Graph* graph, const std::vector& axes, bool keep_dims = false); diff --git a/include/tim/vx/ops/nbg.h b/include/tim/vx/ops/nbg.h index 051c302..d0f8a9f 100644 --- a/include/tim/vx/ops/nbg.h +++ b/include/tim/vx/ops/nbg.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_NBG_H_ #define TIM_VX_OPS_NBG_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -36,7 +36,7 @@ namespace ops { * a bianry file. */ -class NBG : public DirectMapOp { +class NBG : public BuiltinOp { public: NBG(Graph* graph, const char* binary, size_t input_count, size_t output_count); diff --git a/include/tim/vx/ops/onehot.h b/include/tim/vx/ops/onehot.h index 39205a0..b3299a6 100644 --- a/include/tim/vx/ops/onehot.h +++ b/include/tim/vx/ops/onehot.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPERATION_ONE_HOT_H_ #define TIM_VX_OPERATION_ONE_HOT_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -40,7 +40,7 @@ namespace ops { * - axis : The axis to fill. */ -class OneHot : public DirectMapOp { +class OneHot : public BuiltinOp { public: OneHot(Graph* graph, int32_t depth, float on_value = 1, float off_value = 0, int32_t axis = 0); diff --git a/include/tim/vx/ops/pad.h b/include/tim/vx/ops/pad.h index 6ac1d9b..faafe38 100644 --- a/include/tim/vx/ops/pad.h +++ b/include/tim/vx/ops/pad.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPERATION_PAD_H_ #define TIM_VX_OPERATION_PAD_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -40,7 +40,7 @@ namespace ops { * - back_size : Add pad values to the right and bottom. */ -class Pad : public DirectMapOp { +class Pad : public BuiltinOp { public: typedef enum { // signature diff --git a/include/tim/vx/ops/pool2d.h b/include/tim/vx/ops/pool2d.h index 9e3bd76..441a5c9 100644 --- a/include/tim/vx/ops/pool2d.h +++ b/include/tim/vx/ops/pool2d.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" #include "tim/vx/types.h" namespace tim { @@ -64,7 +64,7 @@ namespace ops { * */ -class Pool2d : public DirectMapOp { +class Pool2d : public BuiltinOp { public: /* for Classic Pool2d, pool does not support auto-completion of pad value, you need to specify pad size explicitly, it is recommended to use the second api.*/ diff --git a/include/tim/vx/ops/reduce.h b/include/tim/vx/ops/reduce.h index 1964971..5788bf1 100644 --- a/include/tim/vx/ops/reduce.h +++ b/include/tim/vx/ops/reduce.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_REDUCE_H_ #define TIM_VX_OPS_REDUCE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -95,7 +95,7 @@ namespace ops { */ #define DECLARE_REDUCE_OP(NAME) \ - class Reduce##NAME : public DirectMapOp { \ + class Reduce##NAME : public BuiltinOp { \ public: \ Reduce##NAME(Graph* graph, const std::vector& axis, \ bool keep_dims); \ diff --git a/include/tim/vx/ops/relational_operations.h b/include/tim/vx/ops/relational_operations.h index ed02d8a..61b407b 100644 --- a/include/tim/vx/ops/relational_operations.h +++ b/include/tim/vx/ops/relational_operations.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_RELATIONAL_H_ #define TIM_VX_OPS_RELATIONAL_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -56,7 +56,7 @@ namespace ops { */ #define DECLARE_RELATIONAL_OP(NAME) \ - class NAME : public DirectMapOp { \ + class NAME : public BuiltinOp { \ public: \ NAME(Graph* graph); \ std::shared_ptr Clone( \ diff --git a/include/tim/vx/ops/reorg.h b/include/tim/vx/ops/reorg.h index 69a5dcc..29cb3f2 100644 --- a/include/tim/vx/ops/reorg.h +++ b/include/tim/vx/ops/reorg.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_REORG_H_ #define TIM_VX_OPS_REORG_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -35,7 +35,7 @@ namespace ops { * The layer used in YOLOv2. See also https://github.com/pjreddie/darknet/blob/master/src/reorg_layer.c */ -class Reorg : public DirectMapOp { +class Reorg : public BuiltinOp { public: Reorg(Graph* graph, const uint32_t stride); diff --git a/include/tim/vx/ops/reshape.h b/include/tim/vx/ops/reshape.h index 85843de..0e88476 100644 --- a/include/tim/vx/ops/reshape.h +++ b/include/tim/vx/ops/reshape.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_RESHAPE_H_ #define TIM_VX_OPS_RESHAPE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { diff --git a/include/tim/vx/ops/resize.h b/include/tim/vx/ops/resize.h index 26bb7aa..3e76da2 100644 --- a/include/tim/vx/ops/resize.h +++ b/include/tim/vx/ops/resize.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_RESIZE_H_ #define TIM_VX_OPS_RESIZE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -44,7 +44,7 @@ namespace ops { * - target_height / target_width : output height / width. DO NOT use it with factor together. */ -class Resize : public DirectMapOp { +class Resize : public BuiltinOp { public: Resize(Graph* graph, ResizeType type, float factor, bool align_corners, bool half_pixel_centers, int target_height, int target_width, diff --git a/include/tim/vx/ops/resize1d.h b/include/tim/vx/ops/resize1d.h index c1f0968..96f74e7 100644 --- a/include/tim/vx/ops/resize1d.h +++ b/include/tim/vx/ops/resize1d.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_RESIZE1D_H_ #define TIM_VX_OPS_RESIZE1D_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -44,7 +44,7 @@ namespace ops { * - target_height / target_width : output height / width. DO NOT use it with factor together. */ -class Resize1d : public DirectMapOp { +class Resize1d : public BuiltinOp { public: Resize1d(Graph* graph, ResizeType type, float factor, bool align_corners, bool half_pixel_centers, int target_size, diff --git a/include/tim/vx/ops/reverse.h b/include/tim/vx/ops/reverse.h index 4bbc98a..ac0f554 100644 --- a/include/tim/vx/ops/reverse.h +++ b/include/tim/vx/ops/reverse.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_REVERSE_H_ #define TIM_VX_OPS_REVERSE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -37,7 +37,7 @@ namespace ops { * - axis : The indices of the dimensions to reverse. */ -class Reverse : public DirectMapOp { +class Reverse : public BuiltinOp { public: Reverse(Graph* graph, const std::vector& axis); diff --git a/include/tim/vx/ops/roi_align.h b/include/tim/vx/ops/roi_align.h index 0513f5f..1d870ed 100644 --- a/include/tim/vx/ops/roi_align.h +++ b/include/tim/vx/ops/roi_align.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_ROI_ALIGN_H_ #define TIM_VX_OPS_ROI_ALIGN_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -47,7 +47,7 @@ namespace ops { * used to compute the output. */ -class RoiAlign : public DirectMapOp { +class RoiAlign : public BuiltinOp { public: RoiAlign(Graph* graph, int32_t output_height, int32_t output_width, float height_ratio, float width_ratio, int32_t height_sample_num, diff --git a/include/tim/vx/ops/roi_pool.h b/include/tim/vx/ops/roi_pool.h index 311b652..516890a 100644 --- a/include/tim/vx/ops/roi_pool.h +++ b/include/tim/vx/ops/roi_pool.h @@ -25,7 +25,7 @@ #define TIM_VX_OPS_ROI_POOL_H_ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" #include "tim/vx/types.h" namespace tim { @@ -44,7 +44,7 @@ namespace ops { * */ -class RoiPool : public DirectMapOp { +class RoiPool : public BuiltinOp { public: RoiPool(Graph* graph, PoolType type, float scale, const std::array& size); diff --git a/include/tim/vx/ops/scatternd.h b/include/tim/vx/ops/scatternd.h index 1a211f1..ff6657f 100644 --- a/include/tim/vx/ops/scatternd.h +++ b/include/tim/vx/ops/scatternd.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_SCATTERND_H_ #define TIM_VX_OPS_SCATTERND_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -37,7 +37,7 @@ namespace ops { * - shape : The shape of the resulting tensor. */ -class ScatterND : public DirectMapOp { +class ScatterND : public BuiltinOp { public: ScatterND(Graph* graph, const std::vector& shape); diff --git a/include/tim/vx/ops/select.h b/include/tim/vx/ops/select.h index 6f87630..4ae6743 100644 --- a/include/tim/vx/ops/select.h +++ b/include/tim/vx/ops/select.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_SELECT_H_ #define TIM_VX_OPS_SELECT_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -36,7 +36,7 @@ namespace ops { * from both input tensors: O[i] = C[i] ? x[i] : y[i]. */ -class Select : public DirectMapOp { +class Select : public BuiltinOp { public: Select(Graph* graph); diff --git a/include/tim/vx/ops/shuffle_channel.h b/include/tim/vx/ops/shuffle_channel.h index cb45f60..2686a21 100644 --- a/include/tim/vx/ops/shuffle_channel.h +++ b/include/tim/vx/ops/shuffle_channel.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_SHUFFLE_H_ #define TIM_VX_OPS_SHUFFLE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -38,7 +38,7 @@ namespace ops { * ``` */ -class ShuffleChannel : public DirectMapOp { +class ShuffleChannel : public BuiltinOp { public: explicit ShuffleChannel(Graph* graph, int32_t num_groups, int32_t index_axis); std::shared_ptr Clone(std::shared_ptr& graph) const override; diff --git a/include/tim/vx/ops/signal_frame.h b/include/tim/vx/ops/signal_frame.h index c44f484..52c5abe 100644 --- a/include/tim/vx/ops/signal_frame.h +++ b/include/tim/vx/ops/signal_frame.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_SIGNALFRAME_H_ #define TIM_VX_OPS_SIGNALFRAME_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -39,7 +39,7 @@ namespace ops { * ``` */ -class SignalFrame : public DirectMapOp { +class SignalFrame : public BuiltinOp { public: SignalFrame(Graph* graph, uint32_t window_length, uint32_t step, uint32_t pad_end=0, uint32_t axis=0); diff --git a/include/tim/vx/ops/simple_operations.h b/include/tim/vx/ops/simple_operations.h index a1f78d0..7e11324 100644 --- a/include/tim/vx/ops/simple_operations.h +++ b/include/tim/vx/ops/simple_operations.h @@ -23,14 +23,14 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_SIMPLE_OPERATIONS_H_ #define TIM_VX_OPS_SIMPLE_OPERATIONS_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { namespace ops { #define DECLARE_SIMPLE_OP(NAME) \ - class NAME : public DirectMapOp { \ + class NAME : public BuiltinOp { \ public: \ NAME(Graph* graph); \ std::shared_ptr Clone( \ diff --git a/include/tim/vx/ops/slice.h b/include/tim/vx/ops/slice.h index a67b3c6..9f5eadf 100644 --- a/include/tim/vx/ops/slice.h +++ b/include/tim/vx/ops/slice.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_SLICE_H_ #define TIM_VX_OPS_SLICE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -38,7 +38,7 @@ namespace ops { * - length : the size of the slice in each dimension. */ -class Slice : public DirectMapOp { +class Slice : public BuiltinOp { public: Slice(Graph* graph, uint32_t dims, const std::vector& start, const std::vector& length); diff --git a/include/tim/vx/ops/softmax.h b/include/tim/vx/ops/softmax.h index 12f0610..898bdb4 100644 --- a/include/tim/vx/ops/softmax.h +++ b/include/tim/vx/ops/softmax.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_SOFTMAX_H_ #define TIM_VX_OPS_SOFTMAX_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -42,7 +42,7 @@ namespace ops { * ``` */ -class Softmax : public DirectMapOp { +class Softmax : public BuiltinOp { public: Softmax(Graph* graph, float beta, int32_t axis); diff --git a/include/tim/vx/ops/space2batch.h b/include/tim/vx/ops/space2batch.h index 9799104..3827f3f 100644 --- a/include/tim/vx/ops/space2batch.h +++ b/include/tim/vx/ops/space2batch.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -46,7 +46,7 @@ namespace ops { * - pad : the paddings for each spatial dimension of the input tensor. */ -class Space2Batch : public DirectMapOp { +class Space2Batch : public BuiltinOp { public: Space2Batch(Graph* graph, const std::vector& block_size, const std::vector& pad, diff --git a/include/tim/vx/ops/space2depth.h b/include/tim/vx/ops/space2depth.h index 9bea5d7..55b64cb 100644 --- a/include/tim/vx/ops/space2depth.h +++ b/include/tim/vx/ops/space2depth.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_SPACE2DEPTH_H_ #define TIM_VX_OPS_SPACE2DEPTH_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -38,7 +38,7 @@ namespace ops { * transformation of DepthToSpace. */ -class SpaceToDepth : public DirectMapOp { +class SpaceToDepth : public BuiltinOp { public: SpaceToDepth(Graph* graph, std::vector block_size, DataLayout layout = DataLayout::WHCN); diff --git a/include/tim/vx/ops/spatial_transformer.h b/include/tim/vx/ops/spatial_transformer.h index 5775a14..f8a27a0 100644 --- a/include/tim/vx/ops/spatial_transformer.h +++ b/include/tim/vx/ops/spatial_transformer.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_SPATIAL_TRANSFORMER_H_ #define TIM_VX_OPS_SPATIAL_TRANSFORMER_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -40,7 +40,7 @@ namespace ops { It is the output of the localization network. */ -class SpatialTransformer : public DirectMapOp { +class SpatialTransformer : public BuiltinOp { public: SpatialTransformer(Graph* graph, uint32_t output_h, uint32_t output_w, bool has_theta_1_1, bool has_theta_1_2, bool has_theta_1_3, diff --git a/include/tim/vx/ops/split.h b/include/tim/vx/ops/split.h index 0c062b6..6f7a4af 100644 --- a/include/tim/vx/ops/split.h +++ b/include/tim/vx/ops/split.h @@ -25,7 +25,7 @@ #define TIM_VX_OPS_SPLIT_H_ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -40,7 +40,7 @@ namespace ops { * - slices : indicating the number of splits along given axis. */ -class Split : public DirectMapOp { +class Split : public BuiltinOp { public: Split(Graph* graph, uint32_t axis, std::vector slices); diff --git a/include/tim/vx/ops/squeeze.h b/include/tim/vx/ops/squeeze.h index 76841fd..e74057c 100644 --- a/include/tim/vx/ops/squeeze.h +++ b/include/tim/vx/ops/squeeze.h @@ -24,7 +24,7 @@ #ifndef TIM_VX_OPS_SQUEEZE_H_ #define TIM_VX_OPS_SQUEEZE_H_ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -38,7 +38,7 @@ namespace ops { * - axis : the dimensions to squeeze. */ -class Squeeze : public DirectMapOp { +class Squeeze : public BuiltinOp { public: Squeeze(Graph* graph, std::vector axis); diff --git a/include/tim/vx/ops/stack.h b/include/tim/vx/ops/stack.h index 793f0fa..f507554 100644 --- a/include/tim/vx/ops/stack.h +++ b/include/tim/vx/ops/stack.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_STACK_H_ #define TIM_VX_OPS_STACK_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -37,7 +37,7 @@ namespace ops { * Dimensions below the dimension specified by axis will be packed together with other inputs. */ -class Stack : public DirectMapOp { +class Stack : public BuiltinOp { public: Stack(Graph* graph, uint32_t axis, int input_cnt); diff --git a/include/tim/vx/ops/stridedslice.h b/include/tim/vx/ops/stridedslice.h index 7ba6e5c..24817e0 100644 --- a/include/tim/vx/ops/stridedslice.h +++ b/include/tim/vx/ops/stridedslice.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_STRIDEDSLICE_H_ #define TIM_VX_OPS_STRIDEDSLICE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -52,7 +52,7 @@ namespace ops { * e.g. begin[i] = x, end[i] = x + 1. */ -class StridedSlice : public DirectMapOp { +class StridedSlice : public BuiltinOp { public: StridedSlice(Graph* graph, const std::vector begin_dims, const std::vector end_dims, diff --git a/include/tim/vx/ops/svdf.h b/include/tim/vx/ops/svdf.h index cc7256c..3c02edf 100644 --- a/include/tim/vx/ops/svdf.h +++ b/include/tim/vx/ops/svdf.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" #include "tim/vx/types.h" namespace tim { @@ -43,7 +43,7 @@ namespace ops { * - spectrogram_length : corresponds to the fixed-size of the memory. */ -class Svdf : public DirectMapOp { +class Svdf : public BuiltinOp { public: Svdf(Graph* graph, int32_t rank, int32_t num_units, int32_t spectrogram_length); diff --git a/include/tim/vx/ops/tile.h b/include/tim/vx/ops/tile.h index 6caaa8f..798cef6 100644 --- a/include/tim/vx/ops/tile.h +++ b/include/tim/vx/ops/tile.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_TILE_H_ #define TIM_VX_OPS_TILE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -37,7 +37,7 @@ namespace ops { * Length must be the same as the number of dimensions in input. */ -class Tile : public DirectMapOp { +class Tile : public BuiltinOp { public: Tile(Graph* graph, const std::vector& multiples); diff --git a/include/tim/vx/ops/topk.h b/include/tim/vx/ops/topk.h index 36b82fe..188f0c4 100644 --- a/include/tim/vx/ops/topk.h +++ b/include/tim/vx/ops/topk.h @@ -26,7 +26,7 @@ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" #include "tim/vx/types.h" namespace tim { @@ -41,7 +41,7 @@ namespace ops { * - k : Number of top elements to look for along the last dimension. */ -class Topk : public DirectMapOp { +class Topk : public BuiltinOp { public: Topk(Graph* graph, uint32_t k); diff --git a/include/tim/vx/ops/transpose.h b/include/tim/vx/ops/transpose.h index 70d6d9c..0804843 100644 --- a/include/tim/vx/ops/transpose.h +++ b/include/tim/vx/ops/transpose.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_TRANSPOSE_H_ #define TIM_VX_OPS_TRANSPOSE_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -41,7 +41,7 @@ namespace ops { * 2-D input Tensors. */ -class Transpose : public DirectMapOp { +class Transpose : public BuiltinOp { public: Transpose(Graph* graph, const std::vector& perm); diff --git a/include/tim/vx/ops/unidirectional_sequence_gru.h b/include/tim/vx/ops/unidirectional_sequence_gru.h index fe5c461..c019740 100644 --- a/include/tim/vx/ops/unidirectional_sequence_gru.h +++ b/include/tim/vx/ops/unidirectional_sequence_gru.h @@ -25,7 +25,7 @@ #define TIM_VX_OPS_UNIDIRECTIONAL_SEQUENCE_GRU_H_ #include -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" #include "vsi_nn_pub.h" namespace tim { @@ -46,7 +46,7 @@ namespace ops { * in the False case, it will be [feature, timesteps, batch]. */ -class UnidirectionalSequenceGRU : public DirectMapOp { +class UnidirectionalSequenceGRU : public BuiltinOp { public: enum ActivationType { kNONE = 0, diff --git a/include/tim/vx/ops/unidirectional_sequence_lstm.h b/include/tim/vx/ops/unidirectional_sequence_lstm.h index 474684d..ab91d0c 100644 --- a/include/tim/vx/ops/unidirectional_sequence_lstm.h +++ b/include/tim/vx/ops/unidirectional_sequence_lstm.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_UNIDIRECTIONAL_SEQUENCE_LSTM_H_ #define TIM_VX_OPS_UNIDIRECTIONAL_SEQUENCE_LSTM_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -32,7 +32,7 @@ namespace ops { * ## Unidirectional sequence lstm * how to bind input/output: take unidirectional_sequence_lstm_test.cc */ - class UnidirectionalSequenceLstm: public DirectMapOp { + class UnidirectionalSequenceLstm: public BuiltinOp { public: enum ActivationType { kNONE = 0, diff --git a/include/tim/vx/ops/unstack.h b/include/tim/vx/ops/unstack.h index ff663f3..c012f67 100644 --- a/include/tim/vx/ops/unstack.h +++ b/include/tim/vx/ops/unstack.h @@ -23,7 +23,7 @@ *****************************************************************************/ #ifndef TIM_VX_OPS_UNSTACK_H_ #define TIM_VX_OPS_UNSTACK_H_ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" namespace tim { namespace vx { @@ -37,7 +37,7 @@ namespace ops { * Negative values wrap around, so the valid range is [-R, R). */ -class Unstack : public DirectMapOp { +class Unstack : public BuiltinOp { public: Unstack(Graph* graph, int32_t axis, uint32_t output_num); diff --git a/src/tim/transform/ops/activation_layout_inference.h b/src/tim/transform/ops/activation_layout_inference.h index 929d004..f465aa6 100644 --- a/src/tim/transform/ops/activation_layout_inference.h +++ b/src/tim/transform/ops/activation_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/addn_layout_inference.h b/src/tim/transform/ops/addn_layout_inference.h index 9bac523..f8de786 100644 --- a/src/tim/transform/ops/addn_layout_inference.h +++ b/src/tim/transform/ops/addn_layout_inference.h @@ -25,7 +25,7 @@ #define TIM_LAYOUT_INFER_ADDN_LAYOUT_INFERENCE_H_ #include "ops/op_layout_inference.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/addn.h" namespace tim { diff --git a/src/tim/transform/ops/arg_layout_inference.h b/src/tim/transform/ops/arg_layout_inference.h index dfbf044..389512f 100644 --- a/src/tim/transform/ops/arg_layout_inference.h +++ b/src/tim/transform/ops/arg_layout_inference.h @@ -25,7 +25,7 @@ #define TIM_LAYOUT_INFER_ARG_OPS_LAYOUT_INFERENCE_H_ #include "ops/op_layout_inference.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/arg.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/batch2space_layout_inference.h b/src/tim/transform/ops/batch2space_layout_inference.h index 055029e..2cd9983 100644 --- a/src/tim/transform/ops/batch2space_layout_inference.h +++ b/src/tim/transform/ops/batch2space_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { class Batch2SpaceLayoutInfer : public OpLayoutInfer { diff --git a/src/tim/transform/ops/broadcast_layout_inference.h b/src/tim/transform/ops/broadcast_layout_inference.h index 25eacf5..a3213e3 100644 --- a/src/tim/transform/ops/broadcast_layout_inference.h +++ b/src/tim/transform/ops/broadcast_layout_inference.h @@ -26,7 +26,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/concat_layout_inferene.h b/src/tim/transform/ops/concat_layout_inferene.h index 848800b..b214c49 100644 --- a/src/tim/transform/ops/concat_layout_inferene.h +++ b/src/tim/transform/ops/concat_layout_inferene.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/conv2d_layout_inference.h b/src/tim/transform/ops/conv2d_layout_inference.h index 03f8478..e0866a7 100644 --- a/src/tim/transform/ops/conv2d_layout_inference.h +++ b/src/tim/transform/ops/conv2d_layout_inference.h @@ -26,7 +26,7 @@ #include "tim/vx/ops/conv2d.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "permute_vector.h" #include "ops/op_layout_inference.h" diff --git a/src/tim/transform/ops/deconv2d_layout_inference.h b/src/tim/transform/ops/deconv2d_layout_inference.h index 291f847..7f92c00 100644 --- a/src/tim/transform/ops/deconv2d_layout_inference.h +++ b/src/tim/transform/ops/deconv2d_layout_inference.h @@ -26,7 +26,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/deconv.h" namespace tim { diff --git a/src/tim/transform/ops/default_layout_inference.h b/src/tim/transform/ops/default_layout_inference.h index 1797de9..26f53d5 100644 --- a/src/tim/transform/ops/default_layout_inference.h +++ b/src/tim/transform/ops/default_layout_inference.h @@ -33,7 +33,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/depth2space_layout_inference.h b/src/tim/transform/ops/depth2space_layout_inference.h index 7df177a..4d9c4be 100644 --- a/src/tim/transform/ops/depth2space_layout_inference.h +++ b/src/tim/transform/ops/depth2space_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/elementwise_layout_inference.h b/src/tim/transform/ops/elementwise_layout_inference.h index 472446b..79a70ab 100644 --- a/src/tim/transform/ops/elementwise_layout_inference.h +++ b/src/tim/transform/ops/elementwise_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/fullyconnected_layout_inference.h b/src/tim/transform/ops/fullyconnected_layout_inference.h index ac5cd96..aff0ef5 100644 --- a/src/tim/transform/ops/fullyconnected_layout_inference.h +++ b/src/tim/transform/ops/fullyconnected_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/gather_layout_inference.h b/src/tim/transform/ops/gather_layout_inference.h index 99ec6aa..90f6b9e 100644 --- a/src/tim/transform/ops/gather_layout_inference.h +++ b/src/tim/transform/ops/gather_layout_inference.h @@ -25,7 +25,7 @@ #define TIM_LAYOUT_INFER_GATHER_LAYOUT_INFERENCE_H_ #include "ops/op_layout_inference.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/gather.h" namespace tim { diff --git a/src/tim/transform/ops/gather_nd_layout_inference.h b/src/tim/transform/ops/gather_nd_layout_inference.h index 7db8114..1bfc5fe 100644 --- a/src/tim/transform/ops/gather_nd_layout_inference.h +++ b/src/tim/transform/ops/gather_nd_layout_inference.h @@ -25,7 +25,7 @@ #define TIM_LAYOUT_INFER_GATHER_ND_LAYOUT_INFERENCE_H_ #include "ops/op_layout_inference.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/gathernd.h" namespace tim { diff --git a/src/tim/transform/ops/grouped_conv2d_layout_inference.h b/src/tim/transform/ops/grouped_conv2d_layout_inference.h index c124938..26f1dcf 100644 --- a/src/tim/transform/ops/grouped_conv2d_layout_inference.h +++ b/src/tim/transform/ops/grouped_conv2d_layout_inference.h @@ -26,7 +26,7 @@ #include "tim/vx/ops/groupedconv2d.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "permute_vector.h" #include "ops/op_layout_inference.h" diff --git a/src/tim/transform/ops/l2normalization_layout_inference.h b/src/tim/transform/ops/l2normalization_layout_inference.h index ea80e3a..758a009 100644 --- a/src/tim/transform/ops/l2normalization_layout_inference.h +++ b/src/tim/transform/ops/l2normalization_layout_inference.h @@ -25,7 +25,7 @@ #define TIM_LAYOUT_INFER_L2_NORMALIZATION_LAYOUT_INFERENCE_H_ #include "ops/op_layout_inference.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/l2normalization.h" namespace tim { diff --git a/src/tim/transform/ops/logical_layout_inference.h b/src/tim/transform/ops/logical_layout_inference.h index 05e5c87..9c7ef91 100644 --- a/src/tim/transform/ops/logical_layout_inference.h +++ b/src/tim/transform/ops/logical_layout_inference.h @@ -25,7 +25,7 @@ #define TIM_LAYOUT_INFER_LOGICAL_OPS_LAYOUT_INFERENCE_H_ #include "ops/op_layout_inference.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/logical.h" namespace tim { diff --git a/src/tim/transform/ops/lrn_layout_inference.h b/src/tim/transform/ops/lrn_layout_inference.h index 7251411..f9bbd19 100644 --- a/src/tim/transform/ops/lrn_layout_inference.h +++ b/src/tim/transform/ops/lrn_layout_inference.h @@ -27,7 +27,7 @@ #include "tim/vx/ops/localresponsenormalization.h" #include "ops/op_layout_inference.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/op_layout_inference.cc b/src/tim/transform/ops/op_layout_inference.cc index f83bb11..7c2fabe 100644 --- a/src/tim/transform/ops/op_layout_inference.cc +++ b/src/tim/transform/ops/op_layout_inference.cc @@ -24,7 +24,7 @@ #include "op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/transpose.h" #include "type_utils.h" diff --git a/src/tim/transform/ops/pad_layout_inference.h b/src/tim/transform/ops/pad_layout_inference.h index cb4fe5a..af97f68 100644 --- a/src/tim/transform/ops/pad_layout_inference.h +++ b/src/tim/transform/ops/pad_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { class PadLayoutInfer : public OpLayoutInfer { diff --git a/src/tim/transform/ops/pool2d_layout_inference.h b/src/tim/transform/ops/pool2d_layout_inference.h index c36896b..810f944 100644 --- a/src/tim/transform/ops/pool2d_layout_inference.h +++ b/src/tim/transform/ops/pool2d_layout_inference.h @@ -26,7 +26,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/pool2d.h" namespace tim { diff --git a/src/tim/transform/ops/reduce_layout_inference.h b/src/tim/transform/ops/reduce_layout_inference.h index 3480798..2544f32 100644 --- a/src/tim/transform/ops/reduce_layout_inference.h +++ b/src/tim/transform/ops/reduce_layout_inference.h @@ -30,7 +30,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/resize_layout_inference.h b/src/tim/transform/ops/resize_layout_inference.h index 363cdf0..163a7c2 100644 --- a/src/tim/transform/ops/resize_layout_inference.h +++ b/src/tim/transform/ops/resize_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { class ResizeLayoutInfer : public OpLayoutInfer { diff --git a/src/tim/transform/ops/reverse_layout_inference.h b/src/tim/transform/ops/reverse_layout_inference.h index 9f7f17d..50e3da9 100644 --- a/src/tim/transform/ops/reverse_layout_inference.h +++ b/src/tim/transform/ops/reverse_layout_inference.h @@ -25,7 +25,7 @@ #define TIM_LAYOUT_INFER_REVERSE_LAYOUT_INFERENCE_H_ #include "ops/op_layout_inference.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/reverse.h" namespace tim { diff --git a/src/tim/transform/ops/select_layout_inference.h b/src/tim/transform/ops/select_layout_inference.h index b3046be..aa04a86 100644 --- a/src/tim/transform/ops/select_layout_inference.h +++ b/src/tim/transform/ops/select_layout_inference.h @@ -25,7 +25,7 @@ #define TIM_LAYOUT_INFER_SELECT_LAYOUT_INFERENCE_H_ #include "ops/op_layout_inference.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/select.h" namespace tim { diff --git a/src/tim/transform/ops/simple_ops_layout_inference.h b/src/tim/transform/ops/simple_ops_layout_inference.h index 5c50c66..8abb253 100644 --- a/src/tim/transform/ops/simple_ops_layout_inference.h +++ b/src/tim/transform/ops/simple_ops_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/slice_layout_inference.h b/src/tim/transform/ops/slice_layout_inference.h index abfb846..6ba3de7 100644 --- a/src/tim/transform/ops/slice_layout_inference.h +++ b/src/tim/transform/ops/slice_layout_inference.h @@ -25,7 +25,7 @@ #define TIM_LAYOUT_INFER_SLICE_LAYOUT_INFERENCE_H_ #include "ops/op_layout_inference.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "tim/vx/ops/slice.h" namespace tim { diff --git a/src/tim/transform/ops/softmax_layout_inference.h b/src/tim/transform/ops/softmax_layout_inference.h index cbdfa04..0bf469e 100644 --- a/src/tim/transform/ops/softmax_layout_inference.h +++ b/src/tim/transform/ops/softmax_layout_inference.h @@ -26,7 +26,7 @@ #include "tim/vx/ops/softmax.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "permute_vector.h" #include "ops/op_layout_inference.h" diff --git a/src/tim/transform/ops/space2batch_layout_inference.h b/src/tim/transform/ops/space2batch_layout_inference.h index f59683b..8584c56 100644 --- a/src/tim/transform/ops/space2batch_layout_inference.h +++ b/src/tim/transform/ops/space2batch_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { class Space2BatchLayoutInfer : public OpLayoutInfer { diff --git a/src/tim/transform/ops/space2depth_layout_inference.h b/src/tim/transform/ops/space2depth_layout_inference.h index f0111c8..4f0ccf9 100644 --- a/src/tim/transform/ops/space2depth_layout_inference.h +++ b/src/tim/transform/ops/space2depth_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { class SpaceToDepthLayoutInfer : public OpLayoutInfer { diff --git a/src/tim/transform/ops/split_layout_inference.h b/src/tim/transform/ops/split_layout_inference.h index fe93e3d..376fda8 100644 --- a/src/tim/transform/ops/split_layout_inference.h +++ b/src/tim/transform/ops/split_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/squeeze_layout_inference.h b/src/tim/transform/ops/squeeze_layout_inference.h index d58b91b..54590df 100644 --- a/src/tim/transform/ops/squeeze_layout_inference.h +++ b/src/tim/transform/ops/squeeze_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/stack_layout_inference.h b/src/tim/transform/ops/stack_layout_inference.h index 71e4a10..7de26bd 100644 --- a/src/tim/transform/ops/stack_layout_inference.h +++ b/src/tim/transform/ops/stack_layout_inference.h @@ -27,7 +27,7 @@ #include "tim/vx/ops/stack.h" #include "tim/vx/ops/transpose.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "permute_vector.h" #include "ops/op_layout_inference.h" diff --git a/src/tim/transform/ops/stridedslice_layout_inference.h b/src/tim/transform/ops/stridedslice_layout_inference.h index f8c8ca5..d2b1817 100644 --- a/src/tim/transform/ops/stridedslice_layout_inference.h +++ b/src/tim/transform/ops/stridedslice_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/transpose_layout_inference.h b/src/tim/transform/ops/transpose_layout_inference.h index e926a93..b2335bf 100644 --- a/src/tim/transform/ops/transpose_layout_inference.h +++ b/src/tim/transform/ops/transpose_layout_inference.h @@ -28,7 +28,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/transform/ops/unidirectional_lstm_layout_inference.h b/src/tim/transform/ops/unidirectional_lstm_layout_inference.h index b45b271..a250149 100644 --- a/src/tim/transform/ops/unidirectional_lstm_layout_inference.h +++ b/src/tim/transform/ops/unidirectional_lstm_layout_inference.h @@ -32,7 +32,7 @@ #include "ops/op_layout_inference.h" #include "permute_vector.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace transform { diff --git a/src/tim/vx/direct_map_op.cc b/src/tim/vx/builtin_op.cc similarity index 85% rename from src/tim/vx/direct_map_op.cc rename to src/tim/vx/builtin_op.cc index 569d988..998a5e6 100644 --- a/src/tim/vx/direct_map_op.cc +++ b/src/tim/vx/builtin_op.cc @@ -21,15 +21,15 @@ * DEALINGS IN THE SOFTWARE. * *****************************************************************************/ -#include "tim/vx/direct_map_op.h" +#include "tim/vx/builtin_op.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace vx { -DirectMapOp::DirectMapOp(Graph* graph, uint32_t kind, int in_cnt, int out_cnt, +BuiltinOp::BuiltinOp(Graph* graph, uint32_t kind, int in_cnt, int out_cnt, DataLayout layout) { - impl_ = std::make_unique(graph, kind, in_cnt, out_cnt, layout); + impl_ = std::make_unique(graph, kind, in_cnt, out_cnt, layout); } } // namespace vx diff --git a/src/tim/vx/direct_map_op_impl.cc b/src/tim/vx/builtin_op_impl.cc similarity index 89% rename from src/tim/vx/direct_map_op_impl.cc rename to src/tim/vx/builtin_op_impl.cc index 335014b..a1b65ed 100644 --- a/src/tim/vx/direct_map_op_impl.cc +++ b/src/tim/vx/builtin_op_impl.cc @@ -21,13 +21,13 @@ * DEALINGS IN THE SOFTWARE. * *****************************************************************************/ -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" namespace tim { namespace vx { -DirectMapOpImpl::DirectMapOpImpl(Graph* graph, uint32_t kind, int input_cnt, +BuiltinOpImpl::BuiltinOpImpl(Graph* graph, uint32_t kind, int input_cnt, int output_cnt, DataLayout layout) : OpImpl(graph, kind, input_cnt, output_cnt, layout), node_(vsi_nn_AddNode(graph_->graph(), kind_, input_cnt_, output_cnt_, @@ -36,11 +36,11 @@ DirectMapOpImpl::DirectMapOpImpl(Graph* graph, uint32_t kind, int input_cnt, node_->uid = graph_->graph()->cur_nid; } -DirectMapOpImpl::DirectMapOpImpl(Graph* graph,DataLayout layout) +BuiltinOpImpl::BuiltinOpImpl(Graph* graph,DataLayout layout) : OpImpl(graph, layout){} -DirectMapOpImpl& DirectMapOpImpl::BindInput( +BuiltinOpImpl& BuiltinOpImpl::BindInput( const std::shared_ptr& tensor) { inputs_tensor_.push_back(tensor); uint32_t tensor_id = tensor->GetId(); @@ -52,7 +52,7 @@ DirectMapOpImpl& DirectMapOpImpl::BindInput( return *this; } -DirectMapOpImpl& DirectMapOpImpl::BindOutput( +BuiltinOpImpl& BuiltinOpImpl::BindOutput( const std::shared_ptr& tensor) { outputs_tensor_.push_back(tensor); uint32_t tensor_id = tensor->GetId(); @@ -64,7 +64,7 @@ DirectMapOpImpl& DirectMapOpImpl::BindOutput( return *this; } -void DirectMapOpImpl::SetRoundingPolicy(OverflowPolicy overflow_policy, +void BuiltinOpImpl::SetRoundingPolicy(OverflowPolicy overflow_policy, RoundingPolicy rounding_policy, RoundType down_scale_size_rounding, uint32_t accumulator_bits) { @@ -78,7 +78,7 @@ void DirectMapOpImpl::SetRoundingPolicy(OverflowPolicy overflow_policy, #ifdef TIM_VX_ENABLE_CUSTOM_OP CustomOpBaseImpl::CustomOpBaseImpl(Graph* graph, uint32_t operation_id, const void* proc, const char* kernel_name, DataLayout layout) - : DirectMapOpImpl(graph, layout) { + : BuiltinOpImpl(graph, layout) { op_proc_ = proc; vsi_nn_node_t* node = vsi_nn_AddExternalNode(graph_->graph(), operation_id, proc, NULL, kernel_name); diff --git a/src/tim/vx/direct_map_op_impl.h b/src/tim/vx/builtin_op_impl.h similarity index 82% rename from src/tim/vx/direct_map_op_impl.h rename to src/tim/vx/builtin_op_impl.h index 0d0d6d9..d382fc8 100644 --- a/src/tim/vx/direct_map_op_impl.h +++ b/src/tim/vx/builtin_op_impl.h @@ -21,8 +21,8 @@ * DEALINGS IN THE SOFTWARE. * *****************************************************************************/ -#ifndef TIM_VX_DIRECT_MAP_OP_IMPL_H_ -#define TIM_VX_DIRECT_MAP_OP_IMPL_H_ +#ifndef TIM_VX_BUILTIN_OP_IMPL_H_ +#define TIM_VX_BUILTIN_OP_IMPL_H_ #include "vsi_nn_pub.h" #include "graph_private.h" @@ -32,15 +32,15 @@ namespace tim { namespace vx { -class DirectMapOpImpl : public OpImpl { +class BuiltinOpImpl : public OpImpl { public: - DirectMapOpImpl(Graph* graph, uint32_t kind, int input_cnt = 0, + BuiltinOpImpl(Graph* graph, uint32_t kind, int input_cnt = 0, int output_cnt = 0, DataLayout layout = DataLayout::ANY); - DirectMapOpImpl(Graph* graph,DataLayout layout = DataLayout::ANY); - ~DirectMapOpImpl() {} + BuiltinOpImpl(Graph* graph,DataLayout layout = DataLayout::ANY); + ~BuiltinOpImpl() {} - DirectMapOpImpl& BindInput(const std::shared_ptr& tensor) override; - DirectMapOpImpl& BindOutput(const std::shared_ptr& tensor) override; + BuiltinOpImpl& BindInput(const std::shared_ptr& tensor) override; + BuiltinOpImpl& BindOutput(const std::shared_ptr& tensor) override; vsi_nn_node_t* node() override { return this->node_; } void SetNode(vsi_nn_node_t* node) { this->node_ = node; } @@ -63,7 +63,7 @@ class DirectMapOpImpl : public OpImpl { }; #ifdef TIM_VX_ENABLE_CUSTOM_OP -class CustomOpBaseImpl : public DirectMapOpImpl { +class CustomOpBaseImpl : public BuiltinOpImpl { public: CustomOpBaseImpl(Graph* graph, uint32_t operation_id, const void* proc, const char* kernel_name, DataLayout layout = DataLayout::ANY); @@ -75,4 +75,4 @@ class CustomOpBaseImpl : public DirectMapOpImpl { } // namespace vx } // namespace tim -#endif /* TIM_VX_DIRECT_MAP_OP_IMPL_H_ */ +#endif /* TIM_VX_BUILTIN_OP_IMPL_H_ */ diff --git a/src/tim/vx/ops/activations.cc b/src/tim/vx/ops/activations.cc index 89d658c..e9bc324 100644 --- a/src/tim/vx/ops/activations.cc +++ b/src/tim/vx/ops/activations.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/activations.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { #define DEFINE_NO_PARAMETER_ACTIVATION(NAME, VSI_OP_CODE) \ - NAME::NAME(Graph* graph) : DirectMapOp(graph, VSI_OP_CODE) {} \ + NAME::NAME(Graph* graph) : BuiltinOp(graph, VSI_OP_CODE) {} \ std::shared_ptr NAME::Clone(std::shared_ptr& graph) \ const { \ return graph->CreateOperation(); \ @@ -49,7 +49,7 @@ DEFINE_NO_PARAMETER_ACTIVATION(SoftRelu, VSI_NN_OP_SOFTRELU) Elu::Elu(Graph* graph) : Elu(graph, 1) {} Elu::Elu(Graph* graph, float alpha) - : DirectMapOp(graph, VSI_NN_OP_ELU), alpha_(alpha) { + : BuiltinOp(graph, VSI_NN_OP_ELU), alpha_(alpha) { this->impl()->node()->nn_param.elu.alpha = alpha_; } @@ -57,7 +57,7 @@ std::shared_ptr Elu::Clone(std::shared_ptr& graph) const { return graph->CreateOperation(this->alpha_); } -HardSwish::HardSwish(Graph* graph) : DirectMapOp(graph, VSI_NN_OP_SWISH) { +HardSwish::HardSwish(Graph* graph) : BuiltinOp(graph, VSI_NN_OP_SWISH) { this->impl()->node()->nn_param.swish.type = VSI_NN_HSWISH; this->impl()->node()->nn_param.swish.beta = 1.0f; } @@ -67,7 +67,7 @@ std::shared_ptr HardSwish::Clone( return graph->CreateOperation(); } -Swish::Swish(Graph* graph) : DirectMapOp(graph, VSI_NN_OP_SWISH) { +Swish::Swish(Graph* graph) : BuiltinOp(graph, VSI_NN_OP_SWISH) { this->impl()->node()->nn_param.swish.type = VSI_NN_SWISH; this->impl()->node()->nn_param.swish.beta = 1.0f; } @@ -77,7 +77,7 @@ std::shared_ptr Swish::Clone(std::shared_ptr& graph) const { } Prelu::Prelu(Graph* graph, int axis) - : DirectMapOp(graph, VSI_NN_OP_PRELU), axis_(axis) { + : BuiltinOp(graph, VSI_NN_OP_PRELU), axis_(axis) { this->impl()->node()->nn_param.prelu.axis = axis_; } @@ -86,7 +86,7 @@ std::shared_ptr Prelu::Clone(std::shared_ptr& graph) const { } HardSigmoid::HardSigmoid(Graph* graph, float alpha, float beta) - : DirectMapOp(graph, VSI_NN_OP_HARD_SIGMOID), alpha_(alpha), beta_(beta) { + : BuiltinOp(graph, VSI_NN_OP_HARD_SIGMOID), alpha_(alpha), beta_(beta) { this->impl()->node()->nn_param.hard_sigmoid.alpha = alpha_; this->impl()->node()->nn_param.hard_sigmoid.beta = beta_; } @@ -96,7 +96,7 @@ std::shared_ptr HardSigmoid::Clone( return graph->CreateOperation(this->alpha_, this->beta_); } -Tanh::Tanh(Graph* graph) : DirectMapOp(graph, VSI_NN_OP_TANH) { +Tanh::Tanh(Graph* graph) : BuiltinOp(graph, VSI_NN_OP_TANH) { this->impl()->node()->nn_param.tanh.scale_a = 1.0; this->impl()->node()->nn_param.tanh.scale_b = 1.0; } @@ -106,7 +106,7 @@ std::shared_ptr Tanh::Clone(std::shared_ptr& graph) const { } LeakyRelu::LeakyRelu(Graph* graph, float alpha) - : DirectMapOp(graph, VSI_NN_OP_LEAKY_RELU), alpha_(alpha) { + : BuiltinOp(graph, VSI_NN_OP_LEAKY_RELU), alpha_(alpha) { this->impl()->node()->nn_param.activation.leaky_ratio = alpha_; } @@ -116,7 +116,7 @@ std::shared_ptr LeakyRelu::Clone( } Linear::Linear(Graph* graph, float a, float b) - : DirectMapOp(graph, VSI_NN_OP_LINEAR), a_(a), b_(b) { + : BuiltinOp(graph, VSI_NN_OP_LINEAR), a_(a), b_(b) { this->impl()->node()->nn_param.linear.a = a_; this->impl()->node()->nn_param.linear.b = b_; } @@ -126,7 +126,7 @@ std::shared_ptr Linear::Clone(std::shared_ptr& graph) const { } Gelu::Gelu(Graph* graph, bool approximate) - : DirectMapOp(graph, VSI_NN_OP_GELU) { + : BuiltinOp(graph, VSI_NN_OP_GELU) { this->impl()->node()->nn_param.gelu.approximate = approximate; } @@ -137,7 +137,7 @@ std::shared_ptr Gelu::Clone(std::shared_ptr& graph) const { #ifdef _VSI_NN_OP_SELU_H Selu::Selu(Graph* graph, float alpha, float gamma) - : DirectMapOp(graph, VSI_NN_OP_SELU), alpha_(alpha), gamma_(gamma) { + : BuiltinOp(graph, VSI_NN_OP_SELU), alpha_(alpha), gamma_(gamma) { this->impl()->node()->nn_param.selu.alpha = alpha; this->impl()->node()->nn_param.selu.gamma = gamma; } @@ -149,7 +149,7 @@ std::shared_ptr Selu::Clone(std::shared_ptr& graph) const { #ifdef _VSI_NN_OP_CELU_H Celu::Celu(Graph* graph, float alpha) - : DirectMapOp(graph, VSI_NN_OP_CELU), alpha_(alpha) { + : BuiltinOp(graph, VSI_NN_OP_CELU), alpha_(alpha) { this->impl()->node()->nn_param.selu.alpha = alpha; } diff --git a/src/tim/vx/ops/addn.cc b/src/tim/vx/ops/addn.cc index bc51b96..eea9898 100644 --- a/src/tim/vx/ops/addn.cc +++ b/src/tim/vx/ops/addn.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/addn.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" @@ -32,7 +32,7 @@ namespace vx { namespace ops { AddN::AddN(Graph* graph, uint32_t num_inputs) - : DirectMapOp(graph, VSI_NN_OP_ADDN, num_inputs, 1) {} + : BuiltinOp(graph, VSI_NN_OP_ADDN, num_inputs, 1) {} std::shared_ptr AddN::Clone(std::shared_ptr& graph) const { return graph->CreateOperation(this->impl_->input_cnt_); diff --git a/src/tim/vx/ops/arg.cc b/src/tim/vx/ops/arg.cc index d674c92..7f6d471 100644 --- a/src/tim/vx/ops/arg.cc +++ b/src/tim/vx/ops/arg.cc @@ -25,7 +25,7 @@ #include "vsi_nn_pub.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace vx { @@ -33,7 +33,7 @@ namespace ops { #define DEFINE_ARG_OP(NAME, VSI_OP_TYPE, OP_PARAM) \ Arg##NAME::Arg##NAME(Graph* graph, int32_t axis) \ - : DirectMapOp(graph, VSI_NN_OP_ARG##VSI_OP_TYPE), axis_(axis) { \ + : BuiltinOp(graph, VSI_NN_OP_ARG##VSI_OP_TYPE), axis_(axis) { \ this->impl()->node()->nn_param.arg##OP_PARAM.axis = axis_; \ } \ std::shared_ptr Arg##NAME::Clone(std::shared_ptr& graph) \ diff --git a/src/tim/vx/ops/batch2space.cc b/src/tim/vx/ops/batch2space.cc index 7d2c604..b0e1ace 100644 --- a/src/tim/vx/ops/batch2space.cc +++ b/src/tim/vx/ops/batch2space.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/batch2space.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -32,7 +32,7 @@ namespace ops { Batch2Space::Batch2Space(Graph* graph, const std::vector& block_size, const std::vector& crop, DataLayout layout) - : DirectMapOp(graph, VSI_NN_OP_BATCH2SPACE, 0, 0, layout), + : BuiltinOp(graph, VSI_NN_OP_BATCH2SPACE, 0, 0, layout), block_size_(block_size), crop_(crop) { this->impl()->node()->nn_param.batch2space.block_size = block_size_.data(); diff --git a/src/tim/vx/ops/batchnorm.cc b/src/tim/vx/ops/batchnorm.cc index d45ded0..7ad0bab 100644 --- a/src/tim/vx/ops/batchnorm.cc +++ b/src/tim/vx/ops/batchnorm.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/batchnorm.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { BatchNorm::BatchNorm(Graph* graph, float eps, DataLayout input_layout) - : DirectMapOp(graph, VSI_NN_OP_BATCH_NORM, 0, 0, input_layout), eps_(eps) { + : BuiltinOp(graph, VSI_NN_OP_BATCH_NORM, 0, 0, input_layout), eps_(eps) { this->impl()->node()->nn_param.batch_norm.eps = eps_; } diff --git a/src/tim/vx/ops/broadcast.cc b/src/tim/vx/ops/broadcast.cc index 0954f21..3746853 100644 --- a/src/tim/vx/ops/broadcast.cc +++ b/src/tim/vx/ops/broadcast.cc @@ -24,7 +24,7 @@ #include "tim/vx/ops/broadcast.h" #include -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -32,7 +32,7 @@ namespace vx { namespace ops { Broadcast::Broadcast(Graph* graph, const std::vector& shape, const std::vector& dimensions) - : DirectMapOp(graph, VSI_NN_OP_EXPAND_BROADCAST), + : BuiltinOp(graph, VSI_NN_OP_EXPAND_BROADCAST), shape_(shape), dimensions_(dimensions) { this->impl()->node()->nn_param.expand_broadcast.dim_num = shape_.size(); diff --git a/src/tim/vx/ops/clip.cc b/src/tim/vx/ops/clip.cc index f06a2a6..c59f197 100644 --- a/src/tim/vx/ops/clip.cc +++ b/src/tim/vx/ops/clip.cc @@ -25,7 +25,7 @@ #include "vsi_nn_pub.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace vx { @@ -33,7 +33,7 @@ namespace ops { Clip::Clip(Graph* graph, float min, float max) - : DirectMapOp(graph, VSI_NN_OP_CLIP), + : BuiltinOp(graph, VSI_NN_OP_CLIP), min_(min), max_(max) { this->impl()->node()->nn_param.clip.min = min_; diff --git a/src/tim/vx/ops/concat.cc b/src/tim/vx/ops/concat.cc index 56e9f8d..c43ec84 100644 --- a/src/tim/vx/ops/concat.cc +++ b/src/tim/vx/ops/concat.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/concat.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { Concat::Concat(Graph* graph, uint32_t axis, int input_cnt) - : DirectMapOp(graph, VSI_NN_OP_CONCAT, input_cnt, 1), axis_(axis) { + : BuiltinOp(graph, VSI_NN_OP_CONCAT, input_cnt, 1), axis_(axis) { this->impl()->node()->nn_param.concat.axis = axis_; } diff --git a/src/tim/vx/ops/conv1d.cc b/src/tim/vx/ops/conv1d.cc index c35dd5e..d2fb365 100644 --- a/src/tim/vx/ops/conv1d.cc +++ b/src/tim/vx/ops/conv1d.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/conv1d.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -54,7 +54,7 @@ Conv1d::Conv1d(Graph* graph, int32_t weights, PadType padding, uint32_t ksize, uint32_t stride, uint32_t dilation, const std::array& pad, int32_t multiplier, DataLayout input_layout, DataLayout kernel_layout) - : DirectMapOp(graph, VSI_NN_OP_CONV1D, 0, 0, input_layout), + : BuiltinOp(graph, VSI_NN_OP_CONV1D, 0, 0, input_layout), weights_(weights), padding_(padding), ksize_(ksize), diff --git a/src/tim/vx/ops/conv2d.cc b/src/tim/vx/ops/conv2d.cc index a71494e..6466e5f 100644 --- a/src/tim/vx/ops/conv2d.cc +++ b/src/tim/vx/ops/conv2d.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/conv2d.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -59,7 +59,7 @@ Conv2d::Conv2d(Graph* graph, int32_t weights, PadType padding, const std::array& dilation, const std::array& pad, int32_t multiplier, DataLayout input_layout, DataLayout kernel_layout) - : DirectMapOp(graph, VSI_NN_OP_CONV2D, 0, 0, input_layout), + : BuiltinOp(graph, VSI_NN_OP_CONV2D, 0, 0, input_layout), weights_(weights), padding_(padding), ksize_(ksize), diff --git a/src/tim/vx/ops/conv3d.cc b/src/tim/vx/ops/conv3d.cc index 7135a60..967e60f 100644 --- a/src/tim/vx/ops/conv3d.cc +++ b/src/tim/vx/ops/conv3d.cc @@ -22,7 +22,7 @@ * *****************************************************************************/ #include "tim/vx/ops/conv3d.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -57,7 +57,7 @@ Conv3d::Conv3d(Graph* graph, int32_t weights, PadType padding, const std::array& dilation, const std::array& pad, int32_t multiplier, DataLayout input_layout, DataLayout kernel_layout) - : DirectMapOp(graph, VSI_NN_OP_CONV3D, 0, 0, input_layout), + : BuiltinOp(graph, VSI_NN_OP_CONV3D, 0, 0, input_layout), weights_(weights), padding_(padding), ksize_(ksize), diff --git a/src/tim/vx/ops/custom_base.cc b/src/tim/vx/ops/custom_base.cc index 8c538da..69cc8f8 100644 --- a/src/tim/vx/ops/custom_base.cc +++ b/src/tim/vx/ops/custom_base.cc @@ -25,7 +25,7 @@ #include #include #include "tim/vx/ops.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" #include "kernel/vsi_nn_kernel.h" diff --git a/src/tim/vx/ops/deconv.cc b/src/tim/vx/ops/deconv.cc index af043f9..b98a13d 100644 --- a/src/tim/vx/ops/deconv.cc +++ b/src/tim/vx/ops/deconv.cc @@ -25,7 +25,7 @@ #include -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -50,7 +50,7 @@ DeConv2d::DeConv2d(Graph* graph, int32_t oc_count, PadType pad_type, const uint32_t group, DataLayout input_layout, DataLayout kernel_layout) - : DirectMapOp(graph, VSI_NN_OP_DECONVOLUTION, 0, 0, input_layout), + : BuiltinOp(graph, VSI_NN_OP_DECONVOLUTION, 0, 0, input_layout), oc_count_(oc_count), pad_type_(pad_type), ksize_(ksize), diff --git a/src/tim/vx/ops/deconv1d.cc b/src/tim/vx/ops/deconv1d.cc index dfc8d0f..a30d0b4 100644 --- a/src/tim/vx/ops/deconv1d.cc +++ b/src/tim/vx/ops/deconv1d.cc @@ -25,7 +25,7 @@ #include -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -68,7 +68,7 @@ DeConv1d::DeConv1d(Graph* graph, PadType pad_type, uint32_t stride, uint32_t output_padding, const std::array& pad, uint32_t group, DataLayout input_layout, DataLayout kernel_layout) - : DirectMapOp(graph, VSI_NN_OP_DECONVOLUTION1D, 3, 1, input_layout), + : BuiltinOp(graph, VSI_NN_OP_DECONVOLUTION1D, 3, 1, input_layout), oc_count_(0), pad_type_(pad_type), ksize_(0), diff --git a/src/tim/vx/ops/depth2space.cc b/src/tim/vx/ops/depth2space.cc index 6d366c8..8786626 100644 --- a/src/tim/vx/ops/depth2space.cc +++ b/src/tim/vx/ops/depth2space.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/depth2space.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -35,7 +35,7 @@ DepthToSpace::DepthToSpace(Graph* Graph, int block_size, DataLayout layout) DepthToSpace::DepthToSpace(Graph* Graph, int block_size, depth2space_mode mode, DataLayout layout) - : DirectMapOp(Graph, VSI_NN_OP_DEPTH2SPACE, 0, 0, layout), + : BuiltinOp(Graph, VSI_NN_OP_DEPTH2SPACE, 0, 0, layout), block_size_(block_size), mode_(mode) { this->impl()->node()->nn_param.depth2space.block_size = block_size_; diff --git a/src/tim/vx/ops/dropout.cc b/src/tim/vx/ops/dropout.cc index 1c94042..312dbf4 100644 --- a/src/tim/vx/ops/dropout.cc +++ b/src/tim/vx/ops/dropout.cc @@ -25,7 +25,7 @@ #include "vsi_nn_pub.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" namespace tim { namespace vx { @@ -33,7 +33,7 @@ namespace ops { Dropout::Dropout(Graph* graph, float ratio) - : DirectMapOp(graph, VSI_NN_OP_DROPOUT), + : BuiltinOp(graph, VSI_NN_OP_DROPOUT), ratio_(ratio) { this->impl()->node()->nn_param.dropout.ratio = ratio_; } diff --git a/src/tim/vx/ops/elementwise.cc b/src/tim/vx/ops/elementwise.cc index 726b7d5..38e402f 100644 --- a/src/tim/vx/ops/elementwise.cc +++ b/src/tim/vx/ops/elementwise.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/elementwise.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { #define DEFINE_ELEMENTWISE_OP(NAME, VSI_OP_CODE) \ - NAME::NAME(Graph* graph) : DirectMapOp(graph, VSI_OP_CODE, 2, 1) {} \ + NAME::NAME(Graph* graph) : BuiltinOp(graph, VSI_OP_CODE, 2, 1) {} \ std::shared_ptr NAME::Clone(std::shared_ptr& graph) \ const { \ return graph->CreateOperation(); \ @@ -47,7 +47,7 @@ DEFINE_ELEMENTWISE_OP(FloorDiv, VSI_NN_OP_FLOORDIV) #undef DEFINE_ELEMENTWISE_OP Multiply::Multiply(Graph* graph, float scale) - : DirectMapOp(graph, VSI_NN_OP_MULTIPLY, 2, 1) { + : BuiltinOp(graph, VSI_NN_OP_MULTIPLY, 2, 1) { this->impl()->node()->nn_param.multiply.scale = scale; } @@ -58,7 +58,7 @@ std::shared_ptr Multiply::Clone( } Div::Div(Graph* graph, float scale) - : DirectMapOp(graph, VSI_NN_OP_DIVIDE, 2, 1) { + : BuiltinOp(graph, VSI_NN_OP_DIVIDE, 2, 1) { this->impl()->node()->nn_param.divide.scale = scale; } diff --git a/src/tim/vx/ops/erf.cc b/src/tim/vx/ops/erf.cc index e72e265..094e22a 100644 --- a/src/tim/vx/ops/erf.cc +++ b/src/tim/vx/ops/erf.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/erf.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -31,7 +31,7 @@ namespace tim { namespace vx { namespace ops { -Erf::Erf(Graph* graph) : DirectMapOp(graph, VSI_NN_OP_ERF) {} +Erf::Erf(Graph* graph) : BuiltinOp(graph, VSI_NN_OP_ERF) {} std::shared_ptr Erf::Clone(std::shared_ptr& graph) const { return graph->CreateOperation(); diff --git a/src/tim/vx/ops/fullyconnected.cc b/src/tim/vx/ops/fullyconnected.cc index 73259a9..bfcc845 100644 --- a/src/tim/vx/ops/fullyconnected.cc +++ b/src/tim/vx/ops/fullyconnected.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/fullyconnected.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -35,7 +35,7 @@ FullyConnected::FullyConnected(Graph* graph, uint32_t axis) } FullyConnected::FullyConnected(Graph* graph, uint32_t axis, uint32_t weights) - : DirectMapOp(graph, VSI_NN_OP_FCL2), axis_(axis), weights_(weights) { + : BuiltinOp(graph, VSI_NN_OP_FCL2), axis_(axis), weights_(weights) { this->impl()->node()->nn_param.fcl.axis = axis; this->impl()->node()->nn_param.fcl.weights = weights; } diff --git a/src/tim/vx/ops/gather.cc b/src/tim/vx/ops/gather.cc index c62c987..c76cc84 100644 --- a/src/tim/vx/ops/gather.cc +++ b/src/tim/vx/ops/gather.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/gather.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { Gather::Gather(Graph* graph, int axis, int batch_dims) - : DirectMapOp(graph, VSI_NN_OP_GATHER), axis_(axis), batch_dims_(batch_dims) { + : BuiltinOp(graph, VSI_NN_OP_GATHER), axis_(axis), batch_dims_(batch_dims) { this->impl()->node()->nn_param.gather.axis = axis_; this->impl()->node()->nn_param.gather.batch_dims = batch_dims_; } diff --git a/src/tim/vx/ops/gather_elements.cc b/src/tim/vx/ops/gather_elements.cc index aebe962..23da236 100644 --- a/src/tim/vx/ops/gather_elements.cc +++ b/src/tim/vx/ops/gather_elements.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/gather_elements.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { #ifdef _VSI_NN_OP_GATHER_ELEMENTS_H GatherElements::GatherElements(Graph* graph, int axis) - : DirectMapOp(graph, VSI_NN_OP_GATHER_ELEMENTS), axis_(axis) { + : BuiltinOp(graph, VSI_NN_OP_GATHER_ELEMENTS), axis_(axis) { this->impl()->node()->nn_param.gather_elements.axis = axis_; } diff --git a/src/tim/vx/ops/gathernd.cc b/src/tim/vx/ops/gathernd.cc index b6221f4..3bcf1db 100644 --- a/src/tim/vx/ops/gathernd.cc +++ b/src/tim/vx/ops/gathernd.cc @@ -23,14 +23,14 @@ *****************************************************************************/ #include "tim/vx/ops/gathernd.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { namespace vx { namespace ops { -GatherNd::GatherNd(Graph* graph) : DirectMapOp(graph, VSI_NN_OP_GATHER_ND) {} +GatherNd::GatherNd(Graph* graph) : BuiltinOp(graph, VSI_NN_OP_GATHER_ND) {} std::shared_ptr GatherNd::Clone(std::shared_ptr& graph) const { return graph->CreateOperation(); diff --git a/src/tim/vx/ops/groupedconv1d.cc b/src/tim/vx/ops/groupedconv1d.cc index bdd9819..2c15629 100644 --- a/src/tim/vx/ops/groupedconv1d.cc +++ b/src/tim/vx/ops/groupedconv1d.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/groupedconv1d.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -41,7 +41,7 @@ GroupedConv1d::GroupedConv1d(Graph* graph, PadType padding, std::array pad, const uint32_t stride, const uint32_t dilation, uint32_t group, DataLayout input_layout, DataLayout kernel_layout) - : DirectMapOp(graph, VSI_NN_OP_GROUPED_CONV1D, 3, 1, input_layout), + : BuiltinOp(graph, VSI_NN_OP_GROUPED_CONV1D, 3, 1, input_layout), padding_(padding), pad_(pad), stride_(stride), diff --git a/src/tim/vx/ops/groupedconv2d.cc b/src/tim/vx/ops/groupedconv2d.cc index a686e97..f04f8a5 100644 --- a/src/tim/vx/ops/groupedconv2d.cc +++ b/src/tim/vx/ops/groupedconv2d.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/groupedconv2d.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -37,7 +37,7 @@ GroupedConv2d::GroupedConv2d(Graph* graph, const std::array& dilation, int32_t group_number, DataLayout input_layout, DataLayout kernel_layout) - : DirectMapOp(graph, VSI_NN_OP_GROUPED_CONV2D, 3, 1, input_layout), + : BuiltinOp(graph, VSI_NN_OP_GROUPED_CONV2D, 3, 1, input_layout), padding_(padding), strides_(strides), dilation_(dilation), pad_({0,0,0,0}), group_number_(group_number), kernel_layout_(kernel_layout) { @@ -55,7 +55,7 @@ GroupedConv2d::GroupedConv2d(Graph* graph, const std::array& dilation, int32_t group_number, DataLayout input_layout, DataLayout kernel_layout) - : DirectMapOp(graph, VSI_NN_OP_GROUPED_CONV2D, 3, 1, input_layout), + : BuiltinOp(graph, VSI_NN_OP_GROUPED_CONV2D, 3, 1, input_layout), padding_(PadType::AUTO), strides_(strides), dilation_(dilation), pad_(pad), group_number_(group_number), kernel_layout_(kernel_layout) { this->impl()->node()->nn_param.grouped_conv2d.stride[0] = strides_[0]; diff --git a/src/tim/vx/ops/grucell.cc b/src/tim/vx/ops/grucell.cc index 3314731..b31f6c8 100644 --- a/src/tim/vx/ops/grucell.cc +++ b/src/tim/vx/ops/grucell.cc @@ -22,7 +22,7 @@ * *****************************************************************************/ #include "tim/vx/ops/grucell.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -31,7 +31,7 @@ namespace vx { namespace ops { GRUCell::GRUCell(Graph* graph, uint32_t num_units, ActivationType activation, ActivationType recurrent_activation, vsi_bool reset_after) - : DirectMapOp(graph, VSI_NN_OP_GRUCELL), + : BuiltinOp(graph, VSI_NN_OP_GRUCELL), num_units_(num_units), activation_(activation), recurrent_activation_(recurrent_activation), diff --git a/src/tim/vx/ops/instancenormalization.cc b/src/tim/vx/ops/instancenormalization.cc index de2989a..5b8392b 100644 --- a/src/tim/vx/ops/instancenormalization.cc +++ b/src/tim/vx/ops/instancenormalization.cc @@ -23,14 +23,14 @@ *****************************************************************************/ #include "tim/vx/ops/instancenormalization.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { namespace vx { namespace ops { InstanceNormalization::InstanceNormalization(Graph* graph, float eps) - : DirectMapOp(graph, VSI_NN_OP_INSTANCE_NORM), eps_(eps) { + : BuiltinOp(graph, VSI_NN_OP_INSTANCE_NORM), eps_(eps) { this->impl()->node()->nn_param.instancenorm.eps = eps_; } diff --git a/src/tim/vx/ops/l2normalization.cc b/src/tim/vx/ops/l2normalization.cc index 1a7a688..904150e 100644 --- a/src/tim/vx/ops/l2normalization.cc +++ b/src/tim/vx/ops/l2normalization.cc @@ -23,14 +23,14 @@ *****************************************************************************/ #include "tim/vx/ops/l2normalization.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { namespace vx { namespace ops { L2Normalization::L2Normalization(Graph* graph, int32_t axis) - : DirectMapOp(graph, VSI_NN_OP_L2_NORMALIZE), axis_(axis) { + : BuiltinOp(graph, VSI_NN_OP_L2_NORMALIZE), axis_(axis) { this->impl()->node()->nn_param.l2_normalize.axis = axis_; } diff --git a/src/tim/vx/ops/layernormalization.cc b/src/tim/vx/ops/layernormalization.cc index 6c9278c..2a3168c 100644 --- a/src/tim/vx/ops/layernormalization.cc +++ b/src/tim/vx/ops/layernormalization.cc @@ -24,14 +24,14 @@ #include "tim/vx/ops/layernormalization.h" #include -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { namespace vx { namespace ops { LayerNormalization::LayerNormalization(Graph* graph, int32_t axis, float eps) - : DirectMapOp(graph, VSI_NN_OP_LAYER_NORM), axis_(axis), eps_(eps) { + : BuiltinOp(graph, VSI_NN_OP_LAYER_NORM), axis_(axis), eps_(eps) { // Layer normalization shares the parameters of instance normalization. if (axis != 0) { VSILOGE("Layer norm only support axis 0."); diff --git a/src/tim/vx/ops/localresponsenormalization.cc b/src/tim/vx/ops/localresponsenormalization.cc index 9ecc8c1..37338ac 100644 --- a/src/tim/vx/ops/localresponsenormalization.cc +++ b/src/tim/vx/ops/localresponsenormalization.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/localresponsenormalization.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -33,7 +33,7 @@ LocalResponseNormalization::LocalResponseNormalization(Graph* graph, uint32_t size, float alpha, float beta, float bias, int32_t axis) - : DirectMapOp(graph, VSI_NN_OP_LRN2), + : BuiltinOp(graph, VSI_NN_OP_LRN2), size_(size), alpha_(alpha), beta_(beta), diff --git a/src/tim/vx/ops/logical.cc b/src/tim/vx/ops/logical.cc index c7a324b..52addb8 100644 --- a/src/tim/vx/ops/logical.cc +++ b/src/tim/vx/ops/logical.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/logical.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -32,7 +32,7 @@ namespace ops { #define DEFINE_LOGICAL_OP(NAME, VSI_OP_CODE) \ Logical##NAME::Logical##NAME(Graph* graph) \ - : DirectMapOp(graph, VSI_NN_OP_LOGICAL_OPS) { \ + : BuiltinOp(graph, VSI_NN_OP_LOGICAL_OPS) { \ this->impl()->node()->nn_param.relational_ops.op = \ VSI_NN_LOGICAL_##VSI_OP_CODE; \ } \ diff --git a/src/tim/vx/ops/logsoftmax.cc b/src/tim/vx/ops/logsoftmax.cc index ed91336..2af2d47 100644 --- a/src/tim/vx/ops/logsoftmax.cc +++ b/src/tim/vx/ops/logsoftmax.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/logsoftmax.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { LogSoftmax::LogSoftmax(Graph* graph, int32_t axis, float beta) - : DirectMapOp(graph, VSI_NN_OP_LOG_SOFTMAX), axis_(axis), beta_(beta) { + : BuiltinOp(graph, VSI_NN_OP_LOG_SOFTMAX), axis_(axis), beta_(beta) { this->impl()->node()->nn_param.log_softmax.betaValue = beta_; this->impl()->node()->nn_param.log_softmax.axis = axis_; } diff --git a/src/tim/vx/ops/matmul.cc b/src/tim/vx/ops/matmul.cc index eeb3928..e44b018 100644 --- a/src/tim/vx/ops/matmul.cc +++ b/src/tim/vx/ops/matmul.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/matmul.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" #include "type_utils.h" @@ -33,7 +33,7 @@ namespace ops { Matmul::Matmul(Graph* graph, bool transpose_a, bool transpose_b, bool adjoint_a, bool adjoint_b) - : DirectMapOp(graph, VSI_NN_OP_MATRIXMUL), transpose_a_(transpose_a), + : BuiltinOp(graph, VSI_NN_OP_MATRIXMUL), transpose_a_(transpose_a), transpose_b_(transpose_b), adjoint_a_(adjoint_a), adjoint_b_(adjoint_b) { this->impl()->node()->nn_param.matrixmul.transpose[0] = ToVxBool(transpose_a_); this->impl()->node()->nn_param.matrixmul.transpose[1] = ToVxBool(transpose_b_); diff --git a/src/tim/vx/ops/maxpoolwithargmax.cc b/src/tim/vx/ops/maxpoolwithargmax.cc index de8a038..4a55549 100644 --- a/src/tim/vx/ops/maxpoolwithargmax.cc +++ b/src/tim/vx/ops/maxpoolwithargmax.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/maxpoolwithargmax.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -36,7 +36,7 @@ MaxpoolWithArgmax::MaxpoolWithArgmax(Graph* graph, PadType padding, const std::array& stride, RoundType round_type, DataLayout layout) - : DirectMapOp(graph, VSI_NN_OP_POOLWITHARGMAX, 1, 2, layout), + : BuiltinOp(graph, VSI_NN_OP_POOLWITHARGMAX, 1, 2, layout), padding_(padding), ksize_(ksize), stride_(stride), diff --git a/src/tim/vx/ops/maxpoolwithargmax2.cc b/src/tim/vx/ops/maxpoolwithargmax2.cc index b867f5d..7db787f 100644 --- a/src/tim/vx/ops/maxpoolwithargmax2.cc +++ b/src/tim/vx/ops/maxpoolwithargmax2.cc @@ -24,7 +24,7 @@ #ifdef VSI_FEAT_OP_MAXPOOLWITHARGMAX #include "tim/vx/ops/maxpoolwithargmax2.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -37,7 +37,7 @@ MaxpoolWithArgmax2::MaxpoolWithArgmax2(Graph* graph, PadType padding, const std::array& stride, RoundType round_type, DataLayout layout) - : DirectMapOp(graph, VSI_NN_OP_MAXPOOLWITHARGMAX, 1, 2, layout), + : BuiltinOp(graph, VSI_NN_OP_MAXPOOLWITHARGMAX, 1, 2, layout), padding_(padding), ksize_(ksize), stride_(stride), diff --git a/src/tim/vx/ops/maxunpool2d.cc b/src/tim/vx/ops/maxunpool2d.cc index ea6fa3b..c8a850b 100644 --- a/src/tim/vx/ops/maxunpool2d.cc +++ b/src/tim/vx/ops/maxunpool2d.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/maxunpool2d.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -33,7 +33,7 @@ namespace ops { MaxUnpool2d::MaxUnpool2d(Graph* graph, const std::array& ksize, const std::array& stride, DataLayout layout) - : DirectMapOp(graph, VSI_NN_OP_UPSAMPLE, 2, 1, layout), + : BuiltinOp(graph, VSI_NN_OP_UPSAMPLE, 2, 1, layout), ksize_(ksize), stride_(stride) { this->impl()->node()->nn_param.upsample.scale[0] = stride_[0]; this->impl()->node()->nn_param.upsample.scale[1] = stride_[1]; diff --git a/src/tim/vx/ops/mements.cc b/src/tim/vx/ops/mements.cc index f9a5b6e..51554c6 100644 --- a/src/tim/vx/ops/mements.cc +++ b/src/tim/vx/ops/mements.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/moments.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -31,7 +31,7 @@ namespace tim { namespace vx { namespace ops { Moments::Moments(Graph* graph, const std::vector& axes, bool keep_dims) - : DirectMapOp(graph, VSI_NN_OP_MOMENTS), axes_(axes), keep_dims_(keep_dims) { + : BuiltinOp(graph, VSI_NN_OP_MOMENTS), axes_(axes), keep_dims_(keep_dims) { this->impl()->node()->nn_param.moments.axis = axes_.data(); this->impl()->node()->nn_param.moments.axis_num = axes_.size(); this->impl()->node()->nn_param.moments.keep_dim = ToVxBool(keep_dims_); diff --git a/src/tim/vx/ops/nbg.cc b/src/tim/vx/ops/nbg.cc index 34dcdd7..dafae91 100644 --- a/src/tim/vx/ops/nbg.cc +++ b/src/tim/vx/ops/nbg.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/nbg.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { NBG::NBG(Graph* graph, const char* binary, size_t input_count, size_t output_count) - : DirectMapOp(graph, VSI_NN_OP_NBG, input_count, output_count) { + : BuiltinOp(graph, VSI_NN_OP_NBG, input_count, output_count) { this->impl()->node()->nn_param.nbg.url = binary; this->impl()->node()->nn_param.nbg.type = VSI_NN_NBG_POINTER; } diff --git a/src/tim/vx/ops/onehot.cc b/src/tim/vx/ops/onehot.cc index 88fea2b..cd8b72b 100644 --- a/src/tim/vx/ops/onehot.cc +++ b/src/tim/vx/ops/onehot.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/onehot.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { OneHot::OneHot(Graph* graph, int32_t depth, float on_value, float off_value, int32_t axis) - : DirectMapOp(graph, VSI_NN_OP_ONE_HOT), + : BuiltinOp(graph, VSI_NN_OP_ONE_HOT), depth_(depth), on_value_(on_value), off_value_(off_value), diff --git a/src/tim/vx/ops/pad.cc b/src/tim/vx/ops/pad.cc index ca818bc..0728fea 100644 --- a/src/tim/vx/ops/pad.cc +++ b/src/tim/vx/ops/pad.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/pad.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -37,7 +37,7 @@ Pad::Pad(Graph* graph, const std::vector& front_size, Pad::Pad(Graph* graph, const std::vector& front_size, const std::vector& back_size, int32_t const_val, pad_mode_type pad_mode) - : DirectMapOp(graph, VSI_NN_OP_PAD), + : BuiltinOp(graph, VSI_NN_OP_PAD), front_size_(front_size), back_size_(back_size), const_val_(const_val), diff --git a/src/tim/vx/ops/pool2d.cc b/src/tim/vx/ops/pool2d.cc index 169afb2..6b28e77 100644 --- a/src/tim/vx/ops/pool2d.cc +++ b/src/tim/vx/ops/pool2d.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/pool2d.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -36,7 +36,7 @@ Pool2d::Pool2d(Graph* graph, PoolType type, PadType padding, const std::array& ksize, const std::array& stride, RoundType round_type, DataLayout layout) - : DirectMapOp(graph, VSI_NN_OP_POOL, 1, 1, layout), + : BuiltinOp(graph, VSI_NN_OP_POOL, 1, 1, layout), type_(type), padding_(padding), ksize_(ksize), @@ -59,7 +59,7 @@ Pool2d::Pool2d(Graph* graph, PoolType type, const std::array& ksize, const std::array& stride, RoundType round_type, DataLayout layout) - : DirectMapOp(graph, VSI_NN_OP_POOL, 1, 1, layout), + : BuiltinOp(graph, VSI_NN_OP_POOL, 1, 1, layout), type_(type), padding_(PadType::AUTO), ksize_(ksize), stride_(stride), round_type_(round_type), pad_(pad) { Init(); @@ -70,7 +70,7 @@ Pool2d::Pool2d(Graph* graph, PoolType type, const std::array& input_size, RoundType round_type, DataLayout layout) - : DirectMapOp(graph, VSI_NN_OP_POOL, 1, 1, layout), + : BuiltinOp(graph, VSI_NN_OP_POOL, 1, 1, layout), type_(type), padding_(PadType::AUTO), ksize_(input_size), stride_(input_size), round_type_(round_type), pad_({0, 0, 0, 0}) { Init(); @@ -82,7 +82,7 @@ Pool2d::Pool2d(Graph* graph, PoolType type, const std::array& output_size, RoundType round_type, DataLayout layout) - : DirectMapOp(graph, VSI_NN_OP_POOL, 1, 1, layout), + : BuiltinOp(graph, VSI_NN_OP_POOL, 1, 1, layout), type_(type), padding_(PadType::AUTO), round_type_(round_type), pad_({0, 0, 0, 0}) { stride_[0] = floor(input_size[0] / (float)(output_size[0])); diff --git a/src/tim/vx/ops/reduce.cc b/src/tim/vx/ops/reduce.cc index d758bb3..9436563 100644 --- a/src/tim/vx/ops/reduce.cc +++ b/src/tim/vx/ops/reduce.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/reduce.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -33,7 +33,7 @@ namespace ops { #define DEFINE_REDUCE_OP(NAME, VSI_OP_CODE) \ Reduce##NAME::Reduce##NAME(Graph* graph, const std::vector& axis, \ bool keep_dims) \ - : DirectMapOp(graph, VSI_NN_OP_REDUCE), \ + : BuiltinOp(graph, VSI_NN_OP_REDUCE), \ axis_(std::move(axis)), \ keep_dims_(keep_dims) { \ this->impl()->node()->nn_param.reduce.type = VSI_OP_CODE; \ diff --git a/src/tim/vx/ops/relational_operations.cc b/src/tim/vx/ops/relational_operations.cc index c6a9ec5..0584ca6 100644 --- a/src/tim/vx/ops/relational_operations.cc +++ b/src/tim/vx/ops/relational_operations.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/relational_operations.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -32,7 +32,7 @@ namespace ops { #define DEFINE_RELATIONAL_OP(NAME, VSI_OP_CODE) \ NAME::NAME(Graph* graph) \ - : DirectMapOp(graph, VSI_NN_OP_RELATIONAL_OPS, 2, 1) { \ + : BuiltinOp(graph, VSI_NN_OP_RELATIONAL_OPS, 2, 1) { \ this->impl()->node()->nn_param.relational_ops.op = VSI_OP_CODE; \ } \ std::shared_ptr NAME::Clone(std::shared_ptr& graph) \ diff --git a/src/tim/vx/ops/reorg.cc b/src/tim/vx/ops/reorg.cc index 8b3169a..50ebb6e 100644 --- a/src/tim/vx/ops/reorg.cc +++ b/src/tim/vx/ops/reorg.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/reorg.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { Reorg::Reorg(Graph* graph, const uint32_t stride) - : DirectMapOp(graph, VSI_NN_OP_REORG), stride_(stride) { + : BuiltinOp(graph, VSI_NN_OP_REORG), stride_(stride) { this->impl()->node()->nn_param.reorg.stride = stride_; } diff --git a/src/tim/vx/ops/reshape.cc b/src/tim/vx/ops/reshape.cc index a197abb..91c5220 100644 --- a/src/tim/vx/ops/reshape.cc +++ b/src/tim/vx/ops/reshape.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/reshape.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" #include @@ -31,10 +31,10 @@ namespace tim { namespace vx { namespace ops { -class ReshapeImpl : public DirectMapOpImpl { +class ReshapeImpl : public BuiltinOpImpl { public: ReshapeImpl(Graph* graph, const std::vector& shape) - : DirectMapOpImpl(graph, + : BuiltinOpImpl(graph, #ifdef _VSI_NN_OP_RESHAPE2_H VSI_NN_OP_RESHAPE2 #else diff --git a/src/tim/vx/ops/resize.cc b/src/tim/vx/ops/resize.cc index ded4a98..b3a4426 100644 --- a/src/tim/vx/ops/resize.cc +++ b/src/tim/vx/ops/resize.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/resize.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -34,7 +34,7 @@ namespace ops { Resize::Resize(Graph* graph, ResizeType type, float factor, bool align_corners, bool half_pixel_centers, int target_height, int target_width, DataLayout layout) - : DirectMapOp(graph, VSI_NN_OP_RESIZE, 0, 0, layout), + : BuiltinOp(graph, VSI_NN_OP_RESIZE, 0, 0, layout), type_(type), factor_(factor), align_corners_(align_corners), diff --git a/src/tim/vx/ops/resize1d.cc b/src/tim/vx/ops/resize1d.cc index 9e6bbcd..d6b366a 100644 --- a/src/tim/vx/ops/resize1d.cc +++ b/src/tim/vx/ops/resize1d.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/resize1d.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -33,7 +33,7 @@ namespace ops { Resize1d::Resize1d(Graph* graph, ResizeType type, float factor, bool align_corners, bool half_pixel_centers, int target_size, DataLayout layout) - : DirectMapOp(graph, VSI_NN_OP_RESIZE_1D, 0, 0, layout), + : BuiltinOp(graph, VSI_NN_OP_RESIZE_1D, 0, 0, layout), type_(type), factor_(factor), align_corners_(align_corners), diff --git a/src/tim/vx/ops/reverse.cc b/src/tim/vx/ops/reverse.cc index 487d116..7773604 100644 --- a/src/tim/vx/ops/reverse.cc +++ b/src/tim/vx/ops/reverse.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/reverse.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { Reverse::Reverse(Graph* graph, const std::vector& axis) - : DirectMapOp(graph, VSI_NN_OP_REVERSE), axis_(axis) { + : BuiltinOp(graph, VSI_NN_OP_REVERSE), axis_(axis) { this->impl()->node()->nn_param.reverse.axis = axis_.data(); this->impl()->node()->nn_param.reverse.axis_num = axis_.size(); } diff --git a/src/tim/vx/ops/roi_align.cc b/src/tim/vx/ops/roi_align.cc index c36aac1..8120c41 100644 --- a/src/tim/vx/ops/roi_align.cc +++ b/src/tim/vx/ops/roi_align.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/roi_align.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -33,7 +33,7 @@ namespace ops { RoiAlign::RoiAlign(Graph* graph, int32_t output_height, int32_t output_width, float height_ratio, float width_ratio, int32_t height_sample_num, int32_t width_sample_num) - : DirectMapOp(graph, VSI_NN_OP_ROI_ALIGN), + : BuiltinOp(graph, VSI_NN_OP_ROI_ALIGN), output_height_(output_height), output_width_(output_width), height_ratio_(height_ratio), diff --git a/src/tim/vx/ops/roi_pool.cc b/src/tim/vx/ops/roi_pool.cc index 91a94ea..ffad900 100644 --- a/src/tim/vx/ops/roi_pool.cc +++ b/src/tim/vx/ops/roi_pool.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/roi_pool.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "type_utils.h" #include "vsi_nn_pub.h" @@ -33,7 +33,7 @@ namespace ops { RoiPool::RoiPool(Graph* graph, PoolType type, float scale, const std::array& size) - : DirectMapOp(graph, VSI_NN_OP_ROI_POOL), + : BuiltinOp(graph, VSI_NN_OP_ROI_POOL), type_(type), scale_(scale), size_(size) { diff --git a/src/tim/vx/ops/scatternd.cc b/src/tim/vx/ops/scatternd.cc index 0372c41..af39f87 100644 --- a/src/tim/vx/ops/scatternd.cc +++ b/src/tim/vx/ops/scatternd.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/scatternd.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { ScatterND::ScatterND(Graph* graph, const std::vector& shape) - : DirectMapOp(graph, VSI_NN_OP_SCATTER_ND), shape_(shape) { + : BuiltinOp(graph, VSI_NN_OP_SCATTER_ND), shape_(shape) { this->impl()->node()->nn_param.scatter_nd.dim_num = shape_.size(); this->impl()->node()->nn_param.scatter_nd.shape = shape_.data(); } diff --git a/src/tim/vx/ops/select.cc b/src/tim/vx/ops/select.cc index 27ad69b..e7d165a 100644 --- a/src/tim/vx/ops/select.cc +++ b/src/tim/vx/ops/select.cc @@ -23,7 +23,7 @@ *****************************************************************************/ #include "tim/vx/ops/select.h" -#include "direct_map_op_impl.h" +#include "builtin_op_impl.h" #include "vsi_nn_pub.h" namespace tim { @@ -31,7 +31,7 @@ namespace vx { namespace ops { Select::Select(Graph* graph) - : DirectMapOp(graph, VSI_NN_OP_SELECT) {} + : BuiltinOp(graph, VSI_NN_OP_SELECT) {} std::shared_ptr Select::Clone(std::shared_ptr& graph) const { return graph->CreateOperation