def f(x):
    x = tf.reshape(x, shape=((- 1), xdim))
    return tf.squeeze(((tf.cast(tf.sqrt(((2.0 * sigma) / n_feats)), dtype=dtype) * tf.linalg.matrix_transpose(theta)) @ tf.cos(((W @ tf.linalg.matrix_transpose(x)) + tf.tile(b, multiples=(1, tf.shape(x)[0]))))))
def f(x):
    x = tf.reshape(x, shape=((- 1), xdim))
    return tf.squeeze(((tf.cast(tf.sqrt(((2.0 * sigma) / n_feats)), dtype=dtype) * tf.linalg.matrix_transpose(theta)) @ tf.cos(((W @ tf.linalg.matrix_transpose(x)) + tf.tile(b, multiples=(1, tf.shape(x)[0]))))))