def repeat_interleave_dim0(x: Var, repeats_val: int, name: str = None) -> Var:
        """
        on a high level:
             x
             | tile in dim 0
             v
            [x, x, ...]
             | reshape to split the repeats
             v
            [[x],
             [x],
             ...]
             | transpose(1, 0)
             V
            [x^T, x^T, ...]
             | flatten
             V
            result
        """

        translation_kwargs = {}
        if name is not None:
            translation_kwargs["name"] = name

        x_shape = mb.shape(x=x)

        reps = [1] * x.rank
        reps[0] = repeats_val
        x_tiled = mb.tile(x=x, reps=reps)

        split_reps_shape = mb.concat(values=([repeats_val], x_shape), axis=0)
        x_reshaped = mb.reshape(x=x_tiled, shape=split_reps_shape)

        perm = [*range(x.rank + 1)]
        perm[0] = 1
        perm[1] = 0
        x_transposed = mb.transpose(x=x_reshaped, perm=perm)

        x_unaffected_sizes = mb.slice_by_index(x=x_shape, begin=[1], end=[x.rank])
        result_shape = mb.concat(values=([-1], x_unaffected_sizes), axis=0)
        result = mb.reshape(x=x_transposed, shape=result_shape, **translation_kwargs)

        return result

        on a high level:
             x
             | tile in dim 0
             v
            [x, x, ...]
             | reshape to split the repeats
             v
            [[x],
             [x],
             ...]
             | transpose(1, 0)
             V
            [x^T, x^T, ...]
             | flatten
             V
            result
        
coremltools/converters/mil/frontend/torch/ops.py