output_types = super().infer_output_types(input_prop_values)
output_names = list(self.outputs.get_var_infos())

body = self.attrs.body.value

# We skip the iteration_num and condition as they are correctly inferred
initial_types = [v.type for v in list(body.requested_arguments)[2:]]
# We skip the returned condition as it is correctly inferred
carried_types = [v.type for v in list(body.requested_results.values())[1:]]

shape_unchanged_between_iterations = all(
    i_typ == c_typ for i_typ, c_typ in zip(initial_types, carried_types)
)

for name, _, c_typ in zip(output_names, initial_types, carried_types):
    output_types[name] = (
        c_typ if shape_unchanged_between_iterations else loop_erase_shape_info(c_typ)
    )

return output_types
