From 831e2db3d428b2a25d9fe62f80c88cef55d8f369 Mon Sep 17 00:00:00 2001 From: Pavel Esir Date: Fri, 31 Jul 2020 11:28:59 +0300 Subject: [PATCH] corrected a typo `normalize_slice_indices` comment --- model-optimizer/mo/ops/slice.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/model-optimizer/mo/ops/slice.py b/model-optimizer/mo/ops/slice.py index 02af9645ea4698..aee2fac395d907 100644 --- a/model-optimizer/mo/ops/slice.py +++ b/model-optimizer/mo/ops/slice.py @@ -180,6 +180,15 @@ def get_shape_after_slice(input_shape: int, slice_idx: int): return output_shape +def normalize_slice_indices(size: int, start: int, end: int): + # converts slice indices to format in which size of slice can be calculated + start = convert_negative_indices(size, start) + end = convert_negative_indices(size, end) + start = clip_indices(size, start) + end = clip_indices(size, end) + return start, end + + def convert_negative_indices(size: int, val: int): """ Converts negative indices of a tensors: e.g. if val == -1 then convert it to size @@ -202,12 +211,3 @@ def clip_indices(size: int, val: int): else: return val - -def normalize_slice_indices(size: int, start: int, end: int): - # convert slice_indices to format in which size of slice can calculated - start = convert_negative_indices(size, start) - end = convert_negative_indices(size, end) - start = clip_indices(size, start) - end = clip_indices(size, end) - return start, end -