def f_tf(x):
    x = tf.reshape(x, shape=((- 1), input_dim))
    Knm = portfolio_computeKnm(x, X, lengthscales, kern_var)
    val = (mean_constant_tf + ((Knm @ invKmm_tf) @ (Y_tf - mean_constant_tf)))
    return (- tf.reshape(val, shape=(tf.shape(x)[0],)))
def f_tf(x):
    x = tf.reshape(x, shape=((- 1), input_dim))
    Knm = portfolio_computeKnm(x, X, lengthscales, kern_var)
    val = (mean_constant_tf + ((Knm @ invKmm_tf) @ (Y_tf - mean_constant_tf)))
    return (- tf.reshape(val, shape=(tf.shape(x)[0],)))