def _expand_list_to_rank_1(arr):
        """
        We make the elements in begin and end rank 1,
        so the pattern of ``squeeze -> expand_dims`` can be removed
        by the ``fuse_squeeze_expand_dims`` graph pass.
        """
        for i, val in enumerate(arr):
            if isinstance(val, Var):
                if val.rank == 0:
                    arr[i] = mb.expand_dims(x=val, axes=[0])
            else:
                arr[i] = np.array([val])
        return arr

        We make the elements in begin and end rank 1,
        so the pattern of ``squeeze -> expand_dims`` can be removed
        by the ``fuse_squeeze_expand_dims`` graph pass.
        
coremltools/converters/mil/frontend/torch/ops.py