@@ -750,14 +750,14 @@ def _validate_outputs_argument(outputs):
750750 'or of types ct.ImageType/ct.TensorType'
751751 if isinstance (outputs [0 ], str ):
752752 # if one of the elements is a string, all elements must be strings
753- if not all (isinstance (t , str ) for t in outputs ):
753+ if not all ([ isinstance (t , str ) for t in outputs ] ):
754754 raise ValueError (msg_inconsistent_types )
755755 return outputs , [TensorType (name = name ) for name in outputs ]
756756
757757 if isinstance (outputs [0 ], InputType ):
758- if not all (isinstance (t , TensorType ) or isinstance (t , ImageType ) for t in outputs ):
758+ if not all ([ isinstance (t , TensorType ) or isinstance (t , ImageType ) for t in outputs ] ):
759759 raise ValueError (msg_inconsistent_types )
760- if any (t .shape is not None for t in outputs ):
760+ if any ([ t .shape is not None for t in outputs ] ):
761761 msg = "The 'shape' argument must not be specified for the outputs, since it is " \
762762 "automatically inferred from the input shapes and the ops in the model"
763763 raise ValueError (msg )
@@ -777,9 +777,9 @@ def _validate_outputs_argument(outputs):
777777 output_names = [t .name for t in outputs ]
778778 # verify that either all of the entries in output_names is "None" or none of them is "None"
779779 msg_consistent_names = 'Either none or all the outputs must have the "name" argument specified'
780- if output_names [0 ] is None and not all (name is None for name in output_names ):
780+ if output_names [0 ] is None and not all ([ name is None for name in output_names ] ):
781781 raise ValueError (msg_consistent_names )
782- if output_names [0 ] is not None and not all (name is not None for name in output_names ):
782+ if output_names [0 ] is not None and not all ([ name is not None for name in output_names ] ):
783783 raise ValueError (msg_consistent_names )
784784 if output_names [0 ] is not None :
785785 if len (set (output_names )) != len (output_names ):
@@ -914,7 +914,7 @@ def _flatten_list(_inputs):
914914 if inputs is not None :
915915 raise_if_duplicated (inputs )
916916
917- if inputs is not None and not all (isinstance (_input , InputType ) for _input in inputs ):
917+ if inputs is not None and not all ([ isinstance (_input , InputType ) for _input in inputs ] ):
918918 raise ValueError ("Input should be a list of TensorType or ImageType" )
919919
920920 elif exact_source == "pytorch" :
0 commit comments