else:
// Make sure you always wrap the input in keras
inputs = layers.Input(**input_kwargs)
x = inputs
// Create Encoder
for size in _ENCODER_SIZES[:-1]:
x = layers.Dense(size, activation=_NONLINEARITY, **dense_kwargs)(x)
x = layers.Dense(_ENCODER_SIZES[-1], **dense_kwargs)(x)
// Create Decoder
for size in _DECODER_SIZES:
x = layers.Dense(size, activation=_NONLINEARITY, **dense_kwargs)(x)
x = layers.Dense(784, **dense_kwargs)(x)
model = tf.keras.Model(inputs=inputs, outputs=x)
return model