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

fused_post_source = r"""
#include <torch/extension.h>
#include <ATen/cuda/CUDAContext.h>
#include <c10/cuda/CUDAException.h>
#include <cuda_runtime.h>
#include <math.h>
#include <cstdint>
#include <limits>

__device__ __forceinline__ float fused_post_scalar(float v, float s) {
    v = (v > 0.0f) ? v : (0.2f * v);
    v = v + s;
    v = (v < -1.0f) ? -1.0f : ((v > 1.0f) ? 1.0f : v);
    return 0.5f * v * (1.0f + erff(v * 0.70710678118654752440f));
}

__global__ void fused_post_kernel(const float* __restrict__ x,
                                  const float* __restrict__ sum_tensor,
                                  float* __restrict__ out,
                                  long long total,
                                  long long channels,
                                  long long spatial) {
    long long idx = blockIdx.x * (long long)blockDim.x + threadIdx.x;
    if (idx >= total) return;
    long long channel = (idx / spatial) % channels;
    out[idx] = fused_post_scalar(x[idx], sum_tensor[channel]);
}

__global__ void fused_post_vec4_kernel(const float4* __restrict__ x4,
                                       const float* __restrict__ sum_tensor,
                                       float4* __restrict__ out4,
                                       long long total_vec,
                                       long long channels,
                                       long long spatial) {
    long long idx = blockIdx.x * (long long)blockDim.x + threadIdx.x;
    if (idx >= total_vec) return;
    // spatial is divisible by 4 on this path, so a float4 never crosses a channel boundary.
    long long channel = ((idx * 4) / spatial) % channels;
    float s = sum_tensor[channel];
    float4 v = x4[idx];
    v.x = fused_post_scalar(v.x, s);
    v.y = fused_post_scalar(v.y, s);
    v.z = fused_post_scalar(v.z, s);
    v.w = fused_post_scalar(v.w, s);
    out4[idx] = v;
}

torch::Tensor fused_post_cuda(torch::Tensor x, torch::Tensor sum_tensor) {
    TORCH_CHECK(x.is_cuda(), "x must be a CUDA tensor");
    TORCH_CHECK(sum_tensor.is_cuda(), "sum_tensor must be a CUDA tensor");
    TORCH_CHECK(x.scalar_type() == at::kFloat, "x must be float32");
    TORCH_CHECK(sum_tensor.scalar_type() == at::kFloat, "sum_tensor must be float32");
    TORCH_CHECK(x.dim() == 5, "x must be a 5D NCDHW tensor");

    auto x_contig = x.contiguous();
    auto sum_contig = sum_tensor.contiguous();

    const long long channels = x_contig.size(1);
    const long long spatial = x_contig.size(2) * x_contig.size(3) * x_contig.size(4);
    TORCH_CHECK(sum_contig.numel() == channels,
                "sum_tensor must contain one value per output channel");

    auto out = torch::empty_like(x_contig);
    const long long total = x_contig.numel();
    if (total == 0) return out;

    const int block_size = 256;
    const auto stream = at::cuda::getCurrentCUDAStream();
    const bool vec_ok =
        (spatial % 4 == 0) && (total % 4 == 0) &&
        (reinterpret_cast<std::uintptr_t>(x_contig.data_ptr<float>()) % sizeof(float4) == 0) &&
        (reinterpret_cast<std::uintptr_t>(out.data_ptr<float>()) % sizeof(float4) == 0);

    if (vec_ok) {
        const long long total_vec = total / 4;
        const long long num_blocks_ll = (total_vec + block_size - 1) / block_size;
        TORCH_CHECK(num_blocks_ll <= std::numeric_limits<int>::max(), "tensor is too large");
        const unsigned int num_blocks = static_cast<unsigned int>(num_blocks_ll);
        fused_post_vec4_kernel<<<num_blocks, block_size, 0, stream>>>(
            reinterpret_cast<const float4*>(x_contig.data_ptr<float>()),
            sum_contig.data_ptr<float>(),
            reinterpret_cast<float4*>(out.data_ptr<float>()),
            total_vec, channels, spatial);
    } else {
        const long long num_blocks_ll = (total + block_size - 1) / block_size;
        TORCH_CHECK(num_blocks_ll <= std::numeric_limits<int>::max(), "tensor is too large");
        const unsigned int num_blocks = static_cast<unsigned int>(num_blocks_ll);
        fused_post_kernel<<<num_blocks, block_size, 0, stream>>>(
            x_contig.data_ptr<float>(),
            sum_contig.data_ptr<float>(),
            out.data_ptr<float>(),
            total, channels, spatial);
    }
    C10_CUDA_KERNEL_LAUNCH_CHECK();
    return out;
}
"""

fused_post_cpp_source = "torch::Tensor fused_post_cuda(torch::Tensor x, torch::Tensor sum_tensor);"

fused_post = load_inline(
    name="fused_leaky_add_clamp_gelu_3d",
    cpp_sources=fused_post_cpp_source,
    cuda_sources=fused_post_source,
    functions=["fused_post_cuda"],
    verbose=False,
    extra_cflags=["-O3"],
    extra_cuda_cflags=["-O3"],
)


class ModelNew(nn.Module):
    """
    Conv3d is kept in cuDNN; LeakyReLU + channel sum + clamp + GELU are fused
    into one custom CUDA epilogue kernel.
    """
    def __init__(self, in_channels, out_channels, kernel_size, sum_tensor_shape):
        super(ModelNew, self).__init__()
        self.conv = nn.Conv3d(in_channels, out_channels, kernel_size)
        self.sum_tensor = nn.Parameter(torch.randn(sum_tensor_shape))

    def forward(self, x):
        x = self.conv(x)
        return fused_post.fused_post_cuda(x, self.sum_tensor)
```