def init_tdl(model, inputs, labels, device):

    """
    Initialize TDLs using input and label data.

    :param model: NARX model
    :param inputs: inputs
    :param labels: labels
    :param device: device type
    :return: input, labels, input TDL, output TDL
    """

    max_delay_size = max(model.input_delay_size, model.output_delay_size)

    # input tap-delay
    itdl = inputs[:, max_delay_size - model.input_delay_size: max_delay_size, :].to(device)

    # output tap-delay
    otdl = labels[:, max_delay_size - model.output_delay_size: max_delay_size, :].to(device)

    # input and label data
    input = inputs[:, max_delay_size:, :]
    label = labels[:, max_delay_size:, :]

    return input, label, itdl, otdl