for i in range(2):
with tf.variable_scope("conv1d_%s" % str(i)):
filter_shape = [3, inputs.get_shape()[2], num_filters]
W = tf.get_variable(name='W', shape=filter_shape,
initializer=he_normal,
regularizer=regularizer)
out = tf.nn.conv1d(inputs, W, stride=1, padding="SAME")
out = tf.layers.batch_normalization(inputs=out, momentum=0.997, epsilon=1e-5,
center=True, scale=True, training=is_training)
out = tf.nn.relu(out)
print("Conv1D:", out.get_shape())
The code is: