Added support for the MxNet op take (#4071)

This commit is contained in:
Evgeny Lazarev 2021-01-29 15:48:33 +03:00 committed by GitHub
parent 7500bbd3b1
commit 3669205a44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 0 deletions

View File

@ -108,6 +108,7 @@ Standard MXNet\* symbols:
| SoftmaxActivation | No |
| SoftmaxOutput | No |
| SoftSign | No |
| Take | The attribute 'mode' is not supported |
| Tile | No |
| UpSampling | No |
| Where | No |

View File

@ -224,6 +224,7 @@ extensions/front/mxnet/ssd_pattern_remove_transpose.py
extensions/front/mxnet/ssd_reorder_detection_out_inputs.py
extensions/front/mxnet/stack_ext.py
extensions/front/mxnet/swapaxis_ext.py
extensions/front/mxnet/take_ext.py
extensions/front/mxnet/tile_ext.py
extensions/front/mxnet/tile_replacer.py
extensions/front/mxnet/transpose_ext.py

View File

@ -0,0 +1,33 @@
"""
Copyright (C) 2017-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from extensions.ops.gather import AttributedGather
from mo.front.extractor import FrontExtractorOp
from mo.front.mxnet.extractors.utils import get_mxnet_layer_attrs
from mo.graph.graph import Node
class TakeExtractor(FrontExtractorOp):
op = 'take'
enabled = True
@classmethod
def extract(cls, node: Node):
attrs = get_mxnet_layer_attrs(node.symbol_dict)
AttributedGather.update_node_stat(node, {
'axis': attrs.int('axis', 0),
})
return cls.enabled