Skip to content

Commit

Permalink
corrected type hints, added a safety assert
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-esir committed Sep 21, 2023
1 parent 78631a4 commit 4d91f34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/bindings/python/src/openvino/frontend/tensorflow/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ def tf_function(args):
def are_shapes_defined(shape: Union[List, Dict]):
if shape is None:
return False
assert hasattr(shape, '__len__')
if len(shape) == 0:
return False

if isinstance(shape, list):
return np.all([shape is not None for shape in input_shapes])
Expand Down
2 changes: 1 addition & 1 deletion tools/ovc/openvino/tools/ovc/cli_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def is_shape_type(value):
return True
return False

def single_input_to_input_cut_info(input: [tuple, list, PartialShape, Type, type]):
def single_input_to_input_cut_info(input: [str, tuple, list, PartialShape, Type, type]):
"""
Parses parameters of single input to InputCutInfo.
:param input: input cut parameters of single input
Expand Down

0 comments on commit 4d91f34

Please sign in to comment.