From e05b6f74040dce6e241a7e5cd23a5089985f21b9 Mon Sep 17 00:00:00 2001 From: Kainan Cha Date: Tue, 18 May 2021 01:52:03 +0800 Subject: [PATCH] Update operation README with reference These links are for reference only, actually implementation may vary in terms of dimensions and parameters supported. Signed-off-by: Kainan Cha --- src/tim/vx/ops/README.md | 199 ++++++++++++++++++++------------------- 1 file changed, 101 insertions(+), 98 deletions(-) diff --git a/src/tim/vx/ops/README.md b/src/tim/vx/ops/README.md index 01ca5cf..3f59915 100644 --- a/src/tim/vx/ops/README.md +++ b/src/tim/vx/ops/README.md @@ -1,135 +1,136 @@ -TIM-VX API |Internal Op |Status -:------ |:----- |:------ -Add|ADD|Mapped -Multiply|MULTIPLY|Mapped -Conv2d|CONV2D|Mapped +TIM-VX API |Internal Op |Status | Reference +:------ |:----- |:------|:------ +Add|ADD|Mapped|[tf.math.add](https://tensorflow.google.cn/api_docs/python/tf/math/add) +Multiply|MULTIPLY|Mapped|[tf.math.multiply](https://tensorflow.google.cn/api_docs/python/tf/math/multiply) +Conv2d|CONV2D|Mapped|[tf.nn.conv2d](https://tensorflow.google.cn/api_docs/python/tf/nn/conv2d) ||CONV_RELU|Deprecated ||CONV_RELU_POOL|Deprecated ||FCL|Deprecated ||FCL_RELU|Deprecated -Softmax|SOFTMAX|Mapped -Pool2d|POOL|Mapped -LeakyRelu|LEAKY_RELU|Mapped +Softmax|SOFTMAX|Mapped|[tf.nn.softmax](https://tensorflow.google.cn/api_docs/python/tf/nn/softmax) +Pool2d|POOL|Mapped|[tf.nn.pool](https://tensorflow.google.cn/api_docs/python/tf/nn/pool) +LeakyRelu|LEAKY_RELU|Mapped|[tf.nn.leaky_relu](https://tensorflow.google.cn/api_docs/python/tf/nn/leaky_relu) ||LRN|Deprecated -Concat|CONCAT|Mapped -Split|SPLIT|Mapped +Concat|CONCAT|Mapped|[tf.concat](https://tensorflow.google.cn/api_docs/python/tf/concat) +Split|SPLIT|Mapped|[tf.split](https://tensorflow.google.cn/api_docs/python/tf/split) ||NOOP|Unmapped ||ROI_POOL|Unmapped -BatchNorm|BATCH_NORM|Mapped +BatchNorm|BATCH_NORM|Mapped|[tf.nn.batch_normalization](https://tensorflow.google.cn/api_docs/python/tf/nn/batch_normalization) ||PROPOSAL|Unmapped -DeConv2d|DECONVOLUTION|Mapped -Reshape|RESHAPE|Mapped -Transpose|PERMUTE|Mapped -Prelu|PRELU|Mapped +DeConv2d|DECONVOLUTION|Mapped|[tf.nn.conv2d_transpose](https://tensorflow.google.cn/api_docs/python/tf/nn/conv2d_transpose) +Reshape|RESHAPE|Mapped|[tf.reshape](https://tensorflow.google.cn/api_docs/python/tf/reshape) +Transpose|PERMUTE|Mapped|[tf.transpose](https://tensorflow.google.cn/api_docs/python/tf/transpose) +Prelu|PRELU|Mapped|[tf.keras.layers.PReLU](https://tensorflow.google.cn/api_docs/python/tf/keras/layers/PReLU) ||UPSAMPLE|Unmapped -Relu|RELU|Mapped -||RELUN|Deprecated -||LSTM|Unmapped -Reorg|REORG|Mapped -||VARIABLE|Unmapped -L2Normalization|L2_NORMALIZE|Mapped -FullyConnected|FCL2|Mapped -||POOLWITHARGMAX|Unmapped -ArgMax|ARGMAX|Mapped -Maximum|MAXIMUM|Mapped -L2Normalization|L2NORMALIZESCALE|Mapped +Relu|RELU|Mapped|[tf.nn.relu](https://tensorflow.google.cn/api_docs/python/tf/nn/relu) +||RELUN|Deprecated|[tf.keras.layers.ReLU(max_value=N)](https://tensorflow.google.cn/api_docs/python/tf/keras/layers/ReLU) +||LSTM|Unmapped|[tf.keras.layers.LSTM](https://tensorflow.google.cn/api_docs/python/tf/keras/layers/LSTM) +Reorg|REORG|Mapped|[darknet.reorg](https://github.com/pjreddie/darknet/blob/master/src/reorg_layer.c) +||VARIABLE|Unmapped|[tf.variable](https://tensorflow.google.cn/api_docs/python/tf/Variable) +L2Normalization|L2_NORMALIZE|Mapped|[tf.math.l2_normalize](https://tensorflow.google.cn/api_docs/python/tf/math/l2_normalize) +FullyConnected|FCL2|Mapped|[tf.keras.layers.Dense](https://tensorflow.google.cn/api_docs/python/tf/keras/layers/Dense) +||POOLWITHARGMAX|Unmapped|[tf.nn.max_pool_with_argmax](https://tensorflow.google.cn/api_docs/python/tf/nn/max_pool_with_argmax) +ArgMax|ARGMAX|Mapped|[tf.math.argmax](https://tensorflow.google.cn/api_docs/python/tf/math/argmax) +Maximum|MAXIMUM|Mapped|[tf.math.maximum](https://tensorflow.google.cn/api_docs/python/tf/math/maximum) +|L2NORMALIZESCALE|UnMapped| ||CROP|Unmapped -Sub|SUBTRACT|Mapped -Relu6|RELU6|Mapped -Sigmoid|SIGMOID|Mapped -Tanh|TANH|Mapped -Sqrt|SQRT|Mapped -Rsqrt|RSQRT|Mapped -SoftRelu|SOFTRELU|Unmapped -Div|DIVIDE|Mapped -Dropout|DROPOUT|Mapped +Sub|SUBTRACT|Mapped|[tf.math.subtract](https://tensorflow.google.cn/api_docs/python/tf/math/subtract) +Relu6|RELU6|Mapped|[tf.nn.relu6](https://tensorflow.google.cn/api_docs/python/tf/nn/relu6) +Sigmoid|SIGMOID|Mapped|[tf.math.sigmoid](https://tensorflow.google.cn/api_docs/python/tf/math/sigmoid) +Tanh|TANH|Mapped|[tf.math.tanh](https://tensorflow.google.cn/api_docs/python/tf/math/tanh) +Sqrt|SQRT|Mapped|[tf.math.sqrt](https://tensorflow.google.cn/api_docs/python/tf/math/sqrt) +Rsqrt|RSQRT|Mapped|[tf.math.rsqrt](https://tensorflow.google.cn/api_docs/python/tf/math/rsqrt) +SoftRelu|SOFTRELU|Mapped|[tf.math.softplus](https://tensorflow.google.cn/api_docs/python/tf/math/softplus) +Div|DIVIDE|Mapped|[tf.math.divide](https://tensorflow.google.cn/api_docs/python/tf/math/divide) +Dropout|DROPOUT|Mapped|[tf.nn.dropout](https://tensorflow.google.cn/api_docs/python/tf/nn/dropout) ||SHUFFLECHANNEL|Unmapped -Resize|RESIZE|Mapped -Reverse|REVERSE|Mapped -DepthToSpace|DEPTH2SPACE|Mapped -SpaceToDepth|SPACE2DEPTH|Mapped +Resize|RESIZE|Mapped|[tf.image.resize](https://tensorflow.google.cn/api_docs/python/tf/image/resize) +Reverse|REVERSE|Mapped|[tf.reverse](https://tensorflow.google.cn/api_docs/python/tf/reverse) +DepthToSpace|DEPTH2SPACE|Mapped|[tf.nn.depth_to_space](https://tensorflow.google.cn/api_docs/python/tf/nn/depth_to_space) +SpaceToDepth|SPACE2DEPTH|Mapped|[tf.nn.space_to_depth](https://tensorflow.google.cn/api_docs/python/tf/nn/space_to_depth) DataConvert|DATACONVERT|Mapped -||SCALE|Unmapped -Slice|SLICE|Mapped -Elu|ELU|Mapped -Batch2Space|BATCH2SPACE|Mapped -Space2Batch|SPACE2BATCH|Mapped -Pad|PAD|Mapped +||SCALE|Deprecated +Slice|SLICE|Mapped|[tf.slice](https://tensorflow.google.cn/api_docs/python/tf/slice) +Elu|ELU|Mapped|[tf.nn.elu](https://tensorflow.google.cn/api_docs/python/tf/nn/elu) +Batch2Space|BATCH2SPACE|Mapped|[tf.batch_to_space](https://tensorflow.google.cn/api_docs/python/tf/batch_to_space) +Space2Batch|SPACE2BATCH|Mapped|[tf.space_to_batch](https://tensorflow.google.cn/api_docs/python/tf/space_to_batch) +Pad|PAD|Mapped|[tf.pad](https://tensorflow.google.cn/api_docs/python/tf/pad) ||IMAGEPROCESS|Unmapped ||MATRIXMUL|Unmapped ||LSTMUNIT|Unmapped -||LAYER_NORM|Unmapped -ReduceMin|REDUCE_MIN|Mapped -ReduceMax|REDUCE_MAX|Mapped -ReduceAny|REDUCE_ANY|Mapped -ReduceProd|REDUCE_PROD|Mapped -ReduceMean|REDUCE_MEAN|Mapped -||INSTANCE_NORM|Unmapped -||TENSORSTACKCONCAT|Unmapped -StridedSlice|STRIDED_SLICE|Mapped +||LAYER_NORM|Unmapped|[tf.keras.layers.LayerNormalization](https://tensorflow.google.cn/api_docs/python/tf/keras/layers/LayerNormalization) +ReduceMin|REDUCE_MIN|Mapped|[tf.math.reduce_min](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_min) +ReduceMax|REDUCE_MAX|Mapped|[tf.math.reduce_max](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_max) +ReduceAny|REDUCE_ANY|Mapped|[tf.math.reduce_any](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_any) +ReduceProd|REDUCE_PROD|Mapped|[tf.math.reduce_prod](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_prod) +ReduceMean|REDUCE_MEAN|Mapped|[tf.math.reduce_mean](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_mean) +||INSTANCE_NORM|Unmapped|[tfa.layers.InstanceNormalization](https://tensorflow.google.cn/addons/api_docs/python/tfa/layers/InstanceNormalization) +||TENSORSTACKCONCAT|Unmapped| +StridedSlice|STRIDED_SLICE|Mapped|[tf.strided_slice](https://tensorflow.google.cn/api_docs/python/tf/strided_slice) ||SIGNAL_FRAME|Unmapped -||A_TIMES_B_PLUS_C|Unmapped +||A_TIMES_B_PLUS_C|[tf.add(tf.mul(a, X), Y)](https://github.com/hujie-frank/SENet/blob/master/include/caffe/layers/axpy_layer.hpp) ||SVDF|Unmapped -Abs|ABS|Mapped -||CONV1D|Unmapped +Abs|ABS|Mapped|[tf.math.abs](https://tensorflow.google.cn/api_docs/python/tf/math/abs) +||CONV1D|Unmapped|[tf.nn.conv1d](https://tensorflow.google.cn/api_docs/python/tf/nn/conv1d) NBG|NBG|Mapped ||CONCATSHIFT|Unmapped -LocalResponseNormalization|LRN2|Mapped -Greater|RELATIONAL_OPS_GREATER|Mapped -GreaterOrEqual|RELATIONAL_OPS_GREATER_EQUAL|Mapped -Less|RELATIONAL_OPS_LESS|Mapped -LessOrEqual|RELATIONAL_OPS_LESS_EQUAL|Mapped -Equal|RELATIONAL_OPS_EQUAL|Mapped -NotEqual|RELATIONAL_OPS_NOT_EQUAL|Mapped +LocalResponseNormalization|LRN2|Mapped|[tf.nn.local_response_normalization](https://tensorflow.google.cn/api_docs/python/tf/nn/local_response_normalization) +Greater|RELATIONAL_OPS_GREATER|Mapped|[tf.math.greater](https://tensorflow.google.cn/api_docs/python/tf/math/greater) +GreaterOrEqual|RELATIONAL_OPS_GREATER_EQUAL|Mapped|[tf.math.greater_equal](https://tensorflow.google.cn/api_docs/python/tf/math/greater_equal) +Less|RELATIONAL_OPS_LESS|Mapped|[tf.math.less](https://tensorflow.google.cn/api_docs/python/tf/math/less) +LessOrEqual|RELATIONAL_OPS_LESS_EQUAL|Mapped|[tf.math.less_equal](https://tensorflow.google.cn/api_docs/python/tf/math/less_equal) +Equal|RELATIONAL_OPS_EQUAL|Mapped|[tf.math.equal](https://tensorflow.google.cn/api_docs/python/tf/math/equal) +NotEqual|RELATIONAL_OPS_NOT_EQUAL|Mapped|[tf.math.not_equal](https://tensorflow.google.cn/api_docs/python/tf/math/not_equal) ||SYNC_HOST|Unmapped -Pow|POW|Mapped -||FLOORDIV|Unmapped -Minimum|MINIMUM|Mapped +Pow|POW|Mapped|[tf.math.pow](https://tensorflow.google.cn/api_docs/python/tf/math/pow) +||FLOORDIV|Unmapped|[tf.math.floordiv](https://tensorflow.google.cn/api_docs/python/tf/math/floordiv) +Minimum|MINIMUM|Mapped|[tf.math.minimum](https://tensorflow.google.cn/api_docs/python/tf/math/minimum) ||SPATIAL_TRANSFORMER|Unmapped -And/Or|LOGICAL_OPS|Mapped -Select|SELECT|Mapped +And|LOGICAL_OPS|Mapped|[tf.math.logical_and](https://tensorflow.google.cn/api_docs/python/tf/math/logical_and) +Or|LOGICAL_OPS|Mapped|[tf.math.logical_or](https://tensorflow.google.cn/api_docs/python/tf/math/logical_or) +Select|SELECT|Mapped|[tf.experimental.numpy.select](https://tensorflow.google.cn/api_docs/python/tf/experimental/numpy/select) ||LSTMUNIT_ACTIVATION|Unmapped ||LSTMUNIT_OVXLIB|Unmapped ||TENSOR_ADD_MEAN_STDDEV_NORM|Unmapped -Relu1|RELU1|Mapped -Stack|STACK|Mapped -Floor|FLOOR|Mapped -Square|SQUARE|Mapped -Neg|NEG|Mapped -Exp|EXP|Mapped +Relu1|RELU1|Mapped|[tf.keras.layers.ReLU(max_value=1.0)](https://tensorflow.google.cn/api_docs/python/tf/keras/layers/ReLU) +Stack|STACK|Mapped|[tf.stack](https://tensorflow.google.cn/api_docs/python/tf/stack) +Floor|FLOOR|Mapped|[tf.math.floor](https://tensorflow.google.cn/api_docs/python/tf/math/floor) +Square|SQUARE|Mapped|[tf.math.square](https://tensorflow.google.cn/api_docs/python/tf/math/square) +Neg|NEG|Mapped|[tf.math.negative](https://tensorflow.google.cn/api_docs/python/tf/math/negative) +Exp|EXP|Mapped|[tf.math.exp](https://tensorflow.google.cn/api_docs/python/tf/math/exp) ||LSTM_OVXLIB|Unmapped ||PRE_PROCESS_TENSOR|Unmapped ||HASHTABLE_LOOKUP|Unmapped ||EMBEDDING_LOOKUP|Unmapped ||LSH_PROJECTION|Unmapped ||RNN|Unmapped -Clip|CLIP|Mapped +Clip|CLIP|Mapped|[tf.clip_by_value](https://tensorflow.google.cn/api_docs/python/tf/clip_by_value) ||POST_PROCESS|Unmapped ||PRE_PROCESS_GRAY|Unmapped -||UNSTACK|Unmapped +||UNSTACK|Unmapped|[tf.unstack](https://tensorflow.google.cn/api_docs/python/tf/unstack) ||PRE_PROCESS_RGB|Unmapped ||PRE_PROCESS|Unmapped -AddN|ADDN|Mapped +AddN|ADDN|Mapped|[tf.math.add_n](https://tensorflow.google.cn/api_docs/python/tf/math/add_n) ||PRE_PROCESS_YUV420|Unmapped ||EXTRA_ENDING|Unmapped -Gather|GATHER|Mapped -||TILE|Unmapped +Gather|GATHER|Mapped|[tf.gather](https://tensorflow.google.cn/api_docs/python/tf/gather) +||TILE|Unmapped|[tf.tile](https://tensorflow.google.cn/api_docs/python/tf/tile) ||GROUPED_CONV2D|Unmapped -||TOPK|Unmapped +||TOPK|Unmapped|[tf.math.top_k](https://tensorflow.google.cn/api_docs/python/tf/math/top_k) ||PRE_PROCESS_BGRA|Unmapped -LogicalNot|LOGICAL_NOT|Mapped -Sin|SIN|Mapped -Log|LOG|Mapped -ArgMin|ARGMIN|Mapped +LogicalNot|LOGICAL_NOT|Mapped|[tf.math.logical_not](https://tensorflow.google.cn/api_docs/python/tf/math/logical_not) +Sin|SIN|Mapped|[tf.math.sin](https://tensorflow.google.cn/api_docs/python/tf/math/sin) +Log|LOG|Mapped|[tf.math.log](https://tensorflow.google.cn/api_docs/python/tf/math/log) +ArgMin|ARGMIN|Mapped|[tf.math.argmin](https://tensorflow.google.cn/api_docs/python/tf/math/argmin) ||ROI_ALIGN|Unmapped ||HEATMAP_MAX_KEYPOINT|Unmapped ||AXIS_ALIGNED_BBOX_TRANSFORM|Unmapped ||BOX_WITH_NMS_LIMIT|Unmapped ||GENERATE_PROPOSALS|Unmapped ||DETECTION_POSTPROCESS|Unmapped -||RANDOM_MULTINOMIAL|Unmapped -||LOG_SOFTMAX|Unmapped -||RELU_KERAS|Unmapped +||RANDOM_MULTINOMIAL|Unmapped|[tf.random.categorical](https://tensorflow.google.cn/api_docs/python/tf/random/categorical) +||LOG_SOFTMAX|Unmapped|[tf.nn.log_softmax](https://tensorflow.google.cn/api_docs/python/tf/nn/log_softmax) +||RELU_KERAS|Unmapped|[tf.keras.layers.ReLU](https://tensorflow.google.cn/api_docs/python/tf/keras/layers/ReLU) ||GRU_OVXLIB|Unmapped ||GRUCELL_OVXLIB|Unmapped ||UNIDIRECTIONAL_SEQUENCE_RNN|Unmapped @@ -137,20 +138,22 @@ ArgMin|ARGMIN|Mapped ||BIDIRECTIONAL_SEQUENCE_RNN|Unmapped ||BIDIRECTIONAL_SEQUENCE_LSTM|Unmapped ||RNNCELL_OVXLIB|Unmapped -HardSwish|SWISH|Mapped +HardSwish|SWISH|Mapped|[tf.keras.activations.swish](https://tensorflow.google.cn/api_docs/python/tf/keras/activations/swish) ||DEPTHWISE_CONV1D|Unmapped -GatherNd|GATHER_ND|Mapped -Cast|CAST|Mapped -||LINEAR|Unmapped +GatherNd|GATHER_ND|Mapped|[tf.gather_nd](https://tensorflow.google.cn/api_docs/python/tf/gather_nd) +Cast|CAST|Mapped|[tf.cast](https://tensorflow.google.cn/api_docs/python/tf/cast) +||LINEAR|Unmapped|activation f(x) = a*x + b ||BATCHNORM_SINGLE|Unmapped -||MOMENTS|Unmapped -Squeeze|SQUEEZE|Mapped -HardSigmoid|HARD_SIGMOID|Unmapped -Mish|MISH|Unmapped +||MOMENTS|Unmapped|[tf.moments](https://tensorflow.google.cn/api_docs/python/tf/nn/moments) +Squeeze|SQUEEZE|Mapped|[tf.squeeze](https://tensorflow.google.cn/api_docs/python/tf/squeeze) +HardSigmoid|HARD_SIGMOID|Mapped|[tf.keras.activations.hard_sigmoid](https://tensorflow.google.cn/api_docs/python/tf/keras/activations/hard_sigmoid) +Mish|MISH|Mapped|[tfa.activations.mish](https://tensorflow.google.cn/addons/api_docs/python/tfa/activations/mish) ||EXPAND_BROADCAST|Unmapped ||PRE_PROCESS_YUV444|Unmapped ||PRE_PROCESS_NV12|Unmapped -||SCATTER_ND|Unmapped -||DECONVOLUTION1D|Unmapped +||SCATTER_ND|Unmapped|[tf.scatter_nd](https://tensorflow.google.cn/api_docs/python/tf/scatter_nd) +||DECONVOLUTION1D|Unmapped|[tf.nn.conv1d_transpose](https://tensorflow.google.cn/api_docs/python/tf/nn/conv1d_transpose) ||INTERP|Unmapped ||RESIZE_1D|Unmapped + +INFO: Actual implementations may differ from reference link in terms of dimensions and parameters supported