def load_smt_data(model, xt, yt, dyt_dxt=None):
    """
    Utility function to load SMT data more easily

    :param model: SurrogateModel object for which to load training data
    :param xt: smt data points at which response is evaluated
    :param yt: response at xt
    :param dyt_dxt: gradient at xt
    """
    if len(xt.shape) == 1:
        n_x = 1
        m = xt.size
    else:
        m, n_x = xt.shape
    if len(yt.shape) == 1:
        n_y = 1
    else:
        n_y = yt.shape[1]
    xt = xt.reshape((m, n_x))
    yt = yt.reshape((m, n_y))
    model.set_training_values(xt, yt)
    if dyt_dxt is not None:
        dyt_dxt = dyt_dxt.reshape((m, n_x))
        for i in range(n_x):
            model.set_training_derivatives(xt, dyt_dxt[:, (i)].reshape((m, 
                1)), i)
