def convert_padding(params, w_name, scope_name, inputs, layers, weights, names):
print('<STR_LIT>')<EOL>if params['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>if params['<STR_LIT:value>'] != <NUM_LIT:0.0>:<EOL><INDENT>raise AssertionError('<STR_LIT>')<EOL><DEDENT>if names:<EOL><INDENT>tf_name = '<STR_LIT>' + random_string(<NUM_LIT:4>)<EOL><DEDENT>else:<EOL><INDENT>tf_name = w_name + str(random.random())<EOL><DEDENT>padding_name = tf_name<EOL>padding_layer = keras.layers.ZeroPadding2D(<EOL>padding=((params['<STR_LIT>'][<NUM_LIT:2>], params['<STR_LIT>'][<NUM_LIT:6>]), (params['<STR_LIT>'][<NUM_LIT:3>], params['<STR_LIT>'][<NUM_LIT:7>])),<EOL>name=padding_name<EOL>)<EOL>layers[scope_name] = padding_layer(layers[inputs[<NUM_LIT:0>]])<EOL><DEDENT>elif params['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>def target_layer(x, pads=params['<STR_LIT>']):<EOL><INDENT>layer = tf.pad(x, [[<NUM_LIT:0>, <NUM_LIT:0>], [<NUM_LIT:0>, <NUM_LIT:0>], [pads[<NUM_LIT:2>], pads[<NUM_LIT:6>]], [pads[<NUM_LIT:3>], pads[<NUM_LIT:7>]]], '<STR_LIT>')<EOL>return layer<EOL><DEDENT>lambda_layer = keras.layers.Lambda(target_layer)<EOL>layers[scope_name] = lambda_layer(layers[inputs[<NUM_LIT:0>]])<EOL><DEDENT>
Convert padding layer.

Args:
    params: dictionary with layer parameters
    w_name: name prefix in state_dict
    scope_name: pytorch scope name
    inputs: pytorch node inputs
    layers: dictionary with keras tensors
    weights: pytorch state_dict
    names: use short names for keras layers