def METHOD_NAME(fmaps_in, factors, num_fmaps, activation="relu", name="up"):
    if activation is not None:
        activation = getattr(tf.nn, activation)
    conv_trans_layer = getattr(
        tf.layers,
        {2: "conv2d_transpose", 3: "conv3d_transpose"}[fmaps_in.get_shape().ndims - 2],
    )
    fmaps = conv_trans_layer(
        fmaps_in,
        filters=num_fmaps,
        kernel_size=factors,
        strides=factors,
        padding="valid",
        data_format="channels_first",
        activation=activation,
        name=name,
    )
    return fmaps