import torch


def make_separable(ker, channels):
    """Transform a single-channel kernel into a multi-channel separable kernel.

    Args:
        ker (torch.tensor): Single-channel kernel (1, 1, D, H, W).
        channels (int): Number of input/output channels.

    Returns:
        ker (torch.tensor): Multi-channel group kernel (1, 1, D, H, W).

    """
    ndim = torch.as_tensor(ker.shape).numel()
    repetitions = (channels,) + (1,)*(ndim-1)
    ker = ker.repeat(repetitions)
    return ker