Added support for the MxNet op take (#4071)

This commit is contained in:
Evgeny Lazarev authored and GitHub committed 2021-01-29 15:48:33 +03:00
1 parent 7500bbd3b1
commit 3669205a44
3 files changed
+35

No files matched your search

@@ -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