def _resize_data(input_data: Var, dims: Tuple[int], sizes: Tuple[int]) -> Var:
    """
    For each dim in `dims`, resize the input data size to corresponding size in `sizes`.
    If the `size` is smaller than the data's size at `dim`, trim the data to `size`.
    If the `size` is larger, pad zeros to make the data reaches `size`.
    """
    for (dim, size) in zip(dims, sizes):
        if size < input_data.shape[dim]:
            indices = mb.range_1d(start=0, end=size, step=1)
            input_data = mb.gather(x=input_data, indices=indices, axis=dim)
        elif size > input_data.shape[dim]:
            zero_shape = list(input_data.shape)
            zero_shape[dim] = size - input_data.shape[dim]
            zero_data = mb.fill(shape=zero_shape, value=0.0)
            input_data = mb.concat(values=[input_data, zero_data], axis=dim)

    return input_data

    For each dim in `dims`, resize the input data size to corresponding size in `sizes`.
    If the `size` is smaller than the data's size at `dim`, trim the data to `size`.
    If the `size` is larger, pad zeros to make the data reaches `size`.
    
coremltools/converters/mil/mil/passes/defs/lower_complex_dialect_ops.py