def _resnet_block(x, filters, kernel, stride, kernel_posterior_fn):
x = tf.keras.layers.BatchNormalization()(x)<EOL>x = tf.keras.layers.Activation('<STR_LIT:relu>')(x)<EOL>if stride != <NUM_LIT:1> or filters != x.shape[<NUM_LIT:1>]:<EOL><INDENT>shortcut = _projection_shortcut(x, filters, stride, kernel_posterior_fn)<EOL><DEDENT>else:<EOL><INDENT>shortcut = x<EOL><DEDENT>x = tfp.layers.Convolution2DFlipout(<EOL>filters,<EOL>kernel,<EOL>strides=stride,<EOL>padding='<STR_LIT>',<EOL>kernel_posterior_fn=kernel_posterior_fn)(x)<EOL>x = tf.keras.layers.BatchNormalization()(x)<EOL>x = tf.keras.layers.Activation('<STR_LIT:relu>')(x)<EOL>x = tfp.layers.Convolution2DFlipout(<EOL>filters,<EOL>kernel,<EOL>strides=<NUM_LIT:1>,<EOL>padding='<STR_LIT>',<EOL>kernel_posterior_fn=kernel_posterior_fn)(x)<EOL>x = tf.keras.layers.add([x, shortcut])<EOL>return x<EOL>
Network block for ResNet.