```python
import torch
import torch.nn as nn
from torch.utils.cpp_extension import load_inline

_cuda_source = r"""
#include <torch/extension.h>
#include <ATen/AccumulateType.h>
#include <ATen/cuda/CUDAContext.h>
#include <c10/cuda/CUDAGuard.h>
#include <c10/cuda/CUDAException.h>
#include <cuda_runtime.h>
#include <algorithm>

__global__ void subtract_tanh_float4(
    float* __restrict__ x,
    const float* __restrict__ bias,
    int64_t count,
    int64_t spatial,
    int64_t channels)
{
    const int64_t vectors = count / 4;
    const int64_t step = int64_t(blockDim.x) * gridDim.x;
    const int64_t tid = int64_t(blockIdx.x) * blockDim.x + threadIdx.x;

    for (int64_t i = tid; i < vectors; i += step) {
        const int64_t offset = i * 4;
        float4 v = reinterpret_cast<float4*>(x)[i];
        const int64_t c0 = (offset / spatial) % channels;
        const int64_t c3 = ((offset + 3) / spatial) % channels;

        if (c0 == c3) {
            const float b = bias[c0];
            v.x = tanhf(v.x - b);
            v.y = tanhf(v.y - b);
            v.z = tanhf(v.z - b);
            v.w = tanhf(v.w - b);
        } else {
            v.x = tanhf(v.x - bias[c0]);
            v.y = tanhf(v.y - bias[((offset + 1) / spatial) % channels]);
            v.z = tanhf(v.z - bias[((offset + 2) / spatial) % channels]);
            v.w = tanhf(v.w - bias[c3]);
        }
        reinterpret_cast<float4*>(x)[i] = v;
    }

    for (int64_t i = vectors * 4 + tid; i < count; i += step) {
        x[i] = tanhf(x[i] - bias[(i / spatial) % channels]);
    }
}

template <typename scalar_t>
__global__ void subtract_tanh_scalar(
    scalar_t* __restrict__ x,
    const scalar_t* __restrict__ bias,
    int64_t count,
    int64_t spatial,
    int64_t channels)
{
    using acc_t = at::acc_type<scalar_t, true>;
    const int64_t step = int64_t(blockDim.x) * gridDim.x;

    for (int64_t i = int64_t(blockIdx.x) * blockDim.x + threadIdx.x;
         i < count; i += step) {
        // Preserve the rounding of the original subtraction operator.
        const scalar_t difference = static_cast<scalar_t>(
            static_cast<acc_t>(x[i]) -
            static_cast<acc_t>(bias[(i / spatial) % channels]));
        const acc_t value = static_cast<acc_t>(difference);

        if constexpr (std::is_same<acc_t, double>::value) {
            x[i] = static_cast<scalar_t>(tanh(value));
        } else {
            x[i] = static_cast<scalar_t>(tanhf(static_cast<float>(value)));
        }
    }
}

void subtract_tanh_inplace(torch::Tensor x, torch::Tensor bias)
{
    TORCH_CHECK(x.is_cuda() && bias.is_cuda(), "Expected CUDA tensors");
    TORCH_CHECK(x.device() == bias.device(), "Device mismatch");
    TORCH_CHECK(x.scalar_type() == bias.scalar_type(), "Dtype mismatch");
    TORCH_CHECK(x.dim() == 4 && x.is_contiguous(), "Expected contiguous NCHW");
    TORCH_CHECK(bias.is_contiguous() && bias.numel() == x.size(1),
                "Expected one bias value per channel");

    const c10::cuda::CUDAGuard guard(x.device());
    const int64_t count = x.numel();
    if (count == 0) return;

    const int64_t spatial = x.size(2) * x.size(3);
    const int64_t channels = x.size(1);
    constexpr int threads = 256;
    const auto stream = at::cuda::getCurrentCUDAStream();

    if (x.scalar_type() == at::kFloat) {
        const int blocks = static_cast<int>(
            std::min<int64_t>((count + 4 * threads - 1) / (4 * threads), 4096));
        subtract_tanh_float4<<<blocks, threads, 0, stream>>>(
            x.data_ptr<float>(), bias.data_ptr<float>(),
            count, spatial, channels);
    } else {
        const int blocks = static_cast<int>(
            std::min<int64_t>((count + threads - 1) / threads, 4096));
        AT_DISPATCH_FLOATING_TYPES_AND2(
            at::ScalarType::Half, at::ScalarType::BFloat16,
            x.scalar_type(), "subtract_tanh_inplace", [&] {
                subtract_tanh_scalar<scalar_t><<<blocks, threads, 0, stream>>>(
                    x.data_ptr<scalar_t>(), bias.data_ptr<scalar_t>(),
                    count, spatial, channels);
            });
    }
    C10_CUDA_KERNEL_LAUNCH_CHECK();
}
"""

_fused_ops = load_inline(
    name="fused_transpose_conv_subtract_tanh_v1",
    cpp_sources="void subtract_tanh_inplace(torch::Tensor x, torch::Tensor bias);",
    cuda_sources=_cuda_source,
    functions=["subtract_tanh_inplace"],
    extra_cflags=["-O3"],
    extra_cuda_cflags=["-O3"],
    verbose=False,
)


class _SubtractTanh(torch.autograd.Function):
    @staticmethod
    def forward(ctx, x, bias):
        ctx.mark_dirty(x)
        ctx.bias_shape = bias.shape
        _fused_ops.subtract_tanh_inplace(x, bias.contiguous())
        ctx.save_for_backward(x)
        return x

    @staticmethod
    def backward(ctx, grad_output):
        (output,) = ctx.saved_tensors
        grad = grad_output * (1 - output.square())
        grad_x = grad if ctx.needs_input_grad[0] else None
        grad_bias = (
            -grad.sum_to_size(ctx.bias_shape)
            if ctx.needs_input_grad[1]
            else None
        )
        return grad_x, grad_bias


class ModelNew(nn.Module):
    def __init__(
        self,
        in_channels,
        out_channels,
        kernel_size,
        bias_shape,
        stride=2,
        padding=1,
        output_padding=1,
    ):
        super().__init__()
        self.conv_transpose = nn.ConvTranspose2d(
            in_channels,
            out_channels,
            kernel_size,
            stride=stride,
            padding=padding,
            output_padding=output_padding,
        )
        self.bias = nn.Parameter(torch.randn(bias_shape))

    def forward(self, x):
        x = self.conv_transpose(x)
        channel_bias = tuple(self.bias.shape) in (
            (x.shape[1], 1, 1),
            (1, x.shape[1], 1, 1),
        )
        if (
            x.is_cuda
            and x.is_contiguous()
            and channel_bias
            and x.device == self.bias.device
            and x.dtype == self.bias.dtype
            and x.dtype in (
                torch.float16,
                torch.bfloat16,
                torch.float32,
                torch.float64,
            )
        ):
            return _SubtractTanh.apply(x, self.bias)
        return torch.tanh(x - self.bias)
```