def replace_zeros_in_shape(from_shape: List[int], to_shape: List[int]) -> List[int]:
        """
        Replaces 0s in `to_shape` by the corresponding dims in `from_shape`.

        Overrides IOS15's method to demonstrate IOS17's different behaviours.
        """
        if to_shape.count(0):
            # To do right alignment, we reverse the input and do left alignment instead.
            from_shape_reversed = from_shape[::-1]
            to_shape_reversed = to_shape[::-1]
            for idx, to_element in enumerate(to_shape_reversed):
                if to_element == 0:
                    to_shape_reversed[idx] = (
                        from_shape_reversed[idx] if idx < len(from_shape_reversed) else 1
                    )
            # Reverse the result back to make the right alignment.
            to_shape = to_shape_reversed[::-1]
        return to_shape

        Replaces 0s in `to_shape` by the corresponding dims in `from_shape`.

        Overrides IOS15's method to demonstrate IOS17's different behaviours.
        
coremltools/converters/mil/mil/ops/defs/iOS17/tensor_transformation.py