I tried the following approaches:
import tensorflow as tf inp = tf.keras.Input(shape=(None,)) # first approach: bias = tf.Variable(0., shape=(), trainable=True)