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


_cpp_source = """
#include <torch/extension.h>

torch::Tensor fused_pool_swish_max(
    torch::Tensor input,
    torch::Tensor subtract);
"""

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

__device__ __forceinline__ float maximum(float a, float b) {
    return isnan(b) || b > a ? b : a;
}

__global__ void fused_pool_swish_max_kernel(
    const float* __restrict__ input,
    const float* __restrict__ subtract,
    float* __restrict__ output,
    int D,
    int H,
    int W,
    int OD,
    int OH,
    int OW,
    int64_t count)
{
    const int64_t index =
        static_cast<int64_t>(blockIdx.x) * blockDim.x + threadIdx.x;

    if (index >= count) {
        return;
    }

    int64_t position = index;
    const int w = position % OW;
    position /= OW;
    const int h = position % OH;
    position /= OH;
    const int d = position % OD;
    const int64_t n = position / OD;

    const int64_t plane = static_cast<int64_t>(H) * W;
    const int64_t channel_size = static_cast<int64_t>(D) * plane;
    const int64_t base =
        n * 16 * channel_size +
        static_cast<int64_t>(2 * d) * plane +
        static_cast<int64_t>(2 * h) * W +
        2 * w;

    float values[16];
    float channel_max = -CUDART_INF_F;

    #pragma unroll
    for (int c = 0; c < 16; ++c) {
        const float* p = input + base + c * channel_size;

        const float2 a = *reinterpret_cast<const float2*>(p);
        const float2 b = *reinterpret_cast<const float2*>(p + W);
        const float2 e = *reinterpret_cast<const float2*>(p + plane);
        const float2 f = *reinterpret_cast<const float2*>(p + plane + W);

        float value = maximum(a.x, a.y);
        value = maximum(value, b.x);
        value = maximum(value, b.y);
        value = maximum(value, e.x);
        value = maximum(value, e.y);
        value = maximum(value, f.x);
        value = maximum(value, f.y);

        values[c] = value;
        channel_max = maximum(channel_max, value);
    }

    float denominator = 0.0f;

    #pragma unroll
    for (int c = 0; c < 16; ++c) {
        values[c] = __expf(values[c] - channel_max);
        denominator += values[c];
    }

    const float reciprocal = 1.0f / denominator;
    float result = -CUDART_INF_F;

    #pragma unroll
    for (int c = 0; c < 16; ++c) {
        const float probability = values[c] * reciprocal;
        const float shifted = probability - subtract[c];
        const float sigmoid = 1.0f / (1.0f + __expf(-shifted));
        result = maximum(result, shifted * sigmoid);
    }

    output[index] = result;
}

torch::Tensor fused_pool_swish_max(
    torch::Tensor input,
    torch::Tensor subtract)
{
    TORCH_CHECK(input.is_cuda(), "input must be CUDA");
    TORCH_CHECK(subtract.is_cuda(), "subtract must be CUDA");
    TORCH_CHECK(input.device() == subtract.device(), "device mismatch");
    TORCH_CHECK(input.scalar_type() == torch::kFloat32,
                "input must be float32");
    TORCH_CHECK(subtract.scalar_type() == torch::kFloat32,
                "subtract must be float32");
    TORCH_CHECK(input.is_contiguous() && subtract.is_contiguous(),
                "tensors must be contiguous");
    TORCH_CHECK(input.dim() == 5 && input.size(1) == 16,
                "expected NCDHW input with 16 channels");
    TORCH_CHECK(subtract.numel() == 16,
                "expected 16 subtraction parameters");
    TORCH_CHECK(input.size(2) >= 2 && input.size(3) >= 2 &&
                input.size(4) >= 2 && input.size(4) % 2 == 0,
                "unsupported spatial dimensions");

    const c10::cuda::CUDAGuard device_guard(input.device());

    const int D = static_cast<int>(input.size(2));
    const int H = static_cast<int>(input.size(3));
    const int W = static_cast<int>(input.size(4));
    const int OD = D / 2;
    const int OH = H / 2;
    const int OW = W / 2;

    auto output = torch::empty(
        {input.size(0), OD, OH, OW}, input.options());

    const int64_t count = output.numel();
    if (count != 0) {
        constexpr int threads = 128;
        const int blocks = static_cast<int>(
            (count + threads - 1) / threads);

        fused_pool_swish_max_kernel<<<
            blocks, threads, 0, at::cuda::getCurrentCUDAStream()
        >>>(
            input.data_ptr<float>(),
            subtract.data_ptr<float>(),
            output.data_ptr<float>(),
            D, H, W, OD, OH, OW, count);

        C10_CUDA_KERNEL_LAUNCH_CHECK();
    }

    return output;
}
"""

_fused_extension = load_inline(
    name="convtranspose3d_fused_pool_swish_max_v1",
    cpp_sources=_cpp_source,
    cuda_sources=_cuda_source,
    functions=["fused_pool_swish_max"],
    extra_cflags=["-O3"],
    extra_cuda_cflags=["-O3", "--fmad=false"],
    verbose=False,
)


def _triple(value):
    if isinstance(value, int):
        return (value, value, value)
    return tuple(value)


class ModelNew(nn.Module):
    def __init__(
        self,
        in_channels,
        out_channels,
        kernel_size,
        stride,
        padding,
        output_padding,
        pool_kernel_size,
        pool_stride,
        pool_padding,
    ):
        super().__init__()

        self.conv_transpose = nn.ConvTranspose3d(
            in_channels,
            out_channels,
            kernel_size,
            stride=stride,
            padding=padding,
            output_padding=output_padding,
        )
        self.max_pool = nn.MaxPool3d(
            kernel_size=pool_kernel_size,
            stride=pool_stride,
            padding=pool_padding,
        )
        self.subtract = nn.Parameter(torch.randn(out_channels))

        effective_stride = (
            pool_kernel_size if pool_stride is None else pool_stride
        )
        self._use_fused_pool = (
            out_channels == 16
            and _triple(pool_kernel_size) == (2, 2, 2)
            and _triple(effective_stride) == (2, 2, 2)
            and _triple(pool_padding) == (0, 0, 0)
        )

    def forward(self, x):
        x = self.conv_transpose(x)

        if (
            self._use_fused_pool
            and x.is_cuda
            and x.dtype == torch.float32
            and self.subtract.dtype == torch.float32
            and x.size(2) >= 2
            and x.size(3) >= 2
            and x.size(4) >= 2
            and x.size(4) % 2 == 0
        ):
            return _fused_extension.fused_pool_swish_max(
                x.contiguous(), self.subtract.contiguous()
            )

        x = self.max_pool(x)
        x = torch.softmax(x, dim=1)
        x = x - self.subtract.view(1, -1, 1, 1, 1)
        x = torch.sigmoid(x) * x
        return torch.max(x, dim=1)[0]
```