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

_cpp_source = """
#include <torch/extension.h>
torch::Tensor bias_tanh_inplace_cuda(torch::Tensor x, torch::Tensor bias);
"""

_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>

__device__ __forceinline__ float activation(float x) {
    return tanhf(x);
}

__device__ __forceinline__ double activation(double x) {
    return tanh(x);
}

__global__ void bias_tanh_float4(
    float* __restrict__ x,
    const float* __restrict__ bias,
    int64_t numel,
    int64_t spatial,
    int64_t channels
) {
    const int64_t vector_count = numel / 4;
    const int64_t step = int64_t(blockDim.x) * gridDim.x;

    for (int64_t v = int64_t(blockIdx.x) * blockDim.x + threadIdx.x;
         v < vector_count; v += step) {
        const int64_t i = v * 4;
        float4 value = reinterpret_cast<float4*>(x)[v];

        const int64_t first_plane = i / spatial;
        const float b0 = bias[first_plane % channels];
        float b1 = b0, b2 = b0, b3 = b0;

        if ((i + 3) / spatial != first_plane) {
            b1 = bias[((i + 1) / spatial) % channels];
            b2 = bias[((i + 2) / spatial) % channels];
            b3 = bias[((i + 3) / spatial) % channels];
        }

        value.x = tanhf(value.x - b0);
        value.y = tanhf(value.y - b1);
        value.z = tanhf(value.z - b2);
        value.w = tanhf(value.w - b3);
        reinterpret_cast<float4*>(x)[v] = value;
    }

    const int64_t tail = vector_count * 4
        + int64_t(blockIdx.x) * blockDim.x + threadIdx.x;
    if (tail < numel) {
        x[tail] = tanhf(x[tail] - bias[(tail / spatial) % channels]);
    }
}

template <typename scalar_t>
__global__ void bias_tanh_scalar(
    scalar_t* __restrict__ x,
    const scalar_t* __restrict__ bias,
    int64_t numel,
    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 < numel; i += step) {
        // Preserve the intermediate subtraction's dtype rounding.
        scalar_t difference = static_cast<scalar_t>(
            static_cast<acc_t>(x[i]) -
            static_cast<acc_t>(bias[(i / spatial) % channels]));
        x[i] = static_cast<scalar_t>(
            activation(static_cast<acc_t>(difference)));
    }
}

torch::Tensor bias_tanh_inplace_cuda(
    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.is_contiguous() && bias.is_contiguous(),
                "Expected contiguous tensors");
    TORCH_CHECK(x.dim() == 4 && bias.numel() == x.size(1),
                "Expected NCHW input and one bias per channel");
    TORCH_CHECK(x.scalar_type() == bias.scalar_type(), "Dtype mismatch");

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

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

    const bool vectorized =
        x.scalar_type() == at::kFloat &&
        reinterpret_cast<uintptr_t>(x.data_ptr()) % 16 == 0;
    const int64_t work = vectorized ? (numel + 3) / 4 : numel;
    const int64_t requested_blocks = (work + threads - 1) / threads;
    const int blocks = static_cast<int>(
        requested_blocks < 4096 ? requested_blocks : 4096);

    if (vectorized) {
        bias_tanh_float4<<<blocks, threads, 0, stream>>>(
            x.data_ptr<float>(), bias.data_ptr<float>(),
            numel, spatial, channels);
    } else {
        AT_DISPATCH_FLOATING_TYPES_AND2(
            at::ScalarType::Half, at::ScalarType::BFloat16,
            x.scalar_type(), "bias_tanh_inplace_cuda", [&] {
                bias_tanh_scalar<scalar_t><<<blocks, threads, 0, stream>>>(
                    x.data_ptr<scalar_t>(), bias.data_ptr<scalar_t>(),
                    numel, spatial, channels);
            });
    }

    C10_CUDA_KERNEL_LAUNCH_CHECK();
    return x;
}
"""

_fused_ops = load_inline(
    name="deconv_subtract_tanh_inplace_v1",
    cpp_sources=_cpp_source,
    cuda_sources=_cuda_source,
    functions=["bias_tanh_inplace_cuda"],
    extra_cflags=["-O3"],
    extra_cuda_cflags=["-O3"],
    verbose=False,
)


class _BiasTanh(torch.autograd.Function):
    @staticmethod
    def forward(ctx, x, bias):
        ctx.mark_dirty(x)
        result = _fused_ops.bias_tanh_inplace_cuda(x, bias)
        ctx.save_for_backward(result)
        return result

    @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(dim=(0, 2, 3))
            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 self.bias.device == x.device
            and self.bias.dtype == x.dtype
            and x.dtype in (
                torch.float16,
                torch.bfloat16,
                torch.float32,
                torch.float64,
            )
        ):
            return _BiasTanh.apply(
                x, self.bias.reshape(-1).contiguous()
            )

        return torch.tanh(x - self.bias)
```