def convert_dilation_and_compute_result(tf_padding: str, tf_dim_nums: str) -> TfVal:
    no_dilation = ([1] * nb_spatial_dimensions)
    if (not ((list(lhs_dilation) == no_dilation) or (list(rhs_dilation) == no_dilation))):
        raise error('Both LHS and RHS dilations are set.')
    if (list(lhs_dilation) == no_dilation):
        return tf.nn.convolution(lhs, rhs, strides=window_strides, padding=tf_padding, data_format=tf_dim_nums, dilations=rhs_dilation)
    return tf.nn.conv_transpose(lhs, rhs, out_shape, window_strides, padding=tf_padding, data_format=tf_dim_nums, dilations=lhs_dilation)
def convert_dilation_and_compute_result(tf_padding: str, tf_dim_nums: str) -> TfVal:
    no_dilation = ([1] * nb_spatial_dimensions)
    if (not ((list(lhs_dilation) == no_dilation) or (list(rhs_dilation) == no_dilation))):
        raise error('Both LHS and RHS dilations are set.')
    if (list(lhs_dilation) == no_dilation):
        return tf.nn.convolution(lhs, rhs, strides=window_strides, padding=tf_padding, data_format=tf_dim_nums, dilations=rhs_dilation)
    return tf.nn.conv_transpose(lhs, rhs, out_shape, window_strides, padding=tf_padding, data_format=tf_dim_nums, dilations=lhs_dilation)