2 Copyright (c) 2018-2019 Intel Corporation
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
16 from mo.front.caffe.collect_attributes import merge_attrs
17 from mo.front.common.partial_infer.slice import caffe_slice_infer
20 def slice_ext(proto_layer, model_layer):
21 param = proto_layer.slice_param
22 # slice_dim is deprecated parameter and is used as alias for axis
23 # however if slice_dim is defined and axis is default, we use slice_dim
24 if param.slice_dim != 1 and param.axis == 1:
25 axis = param.slice_dim
30 'slice_point': param.slice_point,
32 mapping_rule = merge_attrs(param, update_attrs)
33 if 'slice_point' not in mapping_rule:
34 mapping_rule['slice_point'] = []
37 'infer': caffe_slice_infer