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


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

torch::Tensor fused_activation_cuda(
    torch::Tensor x,
    torch::Tensor bias,
    torch::Tensor addition);
"""

_cuda_source = r"""
#include <torch/extension.h>
#include <c10/cuda/CUDAGuard.h>
#include <c10/cuda/CUDAStream.h>
#include <c10/cuda/CUDAException.h>
#include <cuda_runtime.h>
#include <algorithm>
#include <cstdint>

__device__ __forceinline__ float activate(
    float x, float bias, float addition
) {
    x = __fadd_rn(x, bias);
    x = x > 0.0f ? x : __fmul_rn(0.2f, x);
    x = __fadd_rn(x, addition);
    x = x < -1.0f ? -1.0f : x;
    x = x > 1.0f ? 1.0f : x;

    // GELU's convergent series on the clamped interval [-1, 1].
    const float z = x * x;
    float p = -1.0f / 9676800.0f;
    p = fmaf(p, z,  1.0f / 599040.0f);
    p = fmaf(p, z, -1.0f / 42240.0f);
    p = fmaf(p, z,  1.0f / 3456.0f);
    p = fmaf(p, z, -1.0f / 336.0f);
    p = fmaf(p, z,  1.0f / 40.0f);
    p = fmaf(p, z, -1.0f / 6.0f);
    p = fmaf(p, z,  1.0f);
    return fmaf(0.3989422804014327f * z, p, 0.5f * x);
}

__device__ __forceinline__ float4 activate4(
    float4 x, const float4 b, const float4 a
) {
    x.x = activate(x.x, b.x, a.x);
    x.y = activate(x.y, b.y, a.y);
    x.z = activate(x.z, b.z, a.z);
    x.w = activate(x.w, b.w, a.w);
    return x;
}

__global__ __launch_bounds__(256)
void activation_64_kernel(
    float4* __restrict__ data,
    const float4* __restrict__ bias,
    const float4* __restrict__ addition,
    int64_t vectors
) {
    const int channel = threadIdx.x & 15;
    const float4 b = bias[channel];
    const float4 a = addition[channel];
    const int64_t stride = int64_t(blockDim.x) * gridDim.x;

    for (int64_t i = int64_t(blockIdx.x) * blockDim.x + threadIdx.x;
         i < vectors; i += stride) {
        data[i] = activate4(data[i], b, a);
    }
}

template<bool CHANNELS_LAST>
__global__ __launch_bounds__(256)
void activation_vector_kernel(
    float4* __restrict__ data,
    const float* __restrict__ bias,
    const float* __restrict__ addition,
    int64_t vectors,
    int64_t spatial,
    int channels
) {
    const int64_t stride = int64_t(blockDim.x) * gridDim.x;

    for (int64_t i = int64_t(blockIdx.x) * blockDim.x + threadIdx.x;
         i < vectors; i += stride) {
        float4 b;
        float4 a;
        if (CHANNELS_LAST) {
            const int channel = i % (channels / 4);
            b = reinterpret_cast<const float4*>(bias)[channel];
            a = reinterpret_cast<const float4*>(addition)[channel];
        } else {
            const int channel = ((i * 4) / spatial) % channels;
            const float bv = bias[channel];
            const float av = addition[channel];
            b = make_float4(bv, bv, bv, bv);
            a = make_float4(av, av, av, av);
        }
        data[i] = activate4(data[i], b, a);
    }
}

template<bool CHANNELS_LAST>
__global__ __launch_bounds__(256)
void activation_scalar_kernel(
    float* __restrict__ data,
    const float* __restrict__ bias,
    const float* __restrict__ addition,
    int64_t count,
    int64_t spatial,
    int channels
) {
    const int64_t stride = int64_t(blockDim.x) * gridDim.x;

    for (int64_t i = int64_t(blockIdx.x) * blockDim.x + threadIdx.x;
         i < count; i += stride) {
        const int channel = CHANNELS_LAST
            ? i % channels
            : (i / spatial) % channels;
        data[i] = activate(data[i], bias[channel], addition[channel]);
    }
}

torch::Tensor fused_activation_cuda(
    torch::Tensor x,
    torch::Tensor bias,
    torch::Tensor addition
) {
    TORCH_CHECK(x.is_cuda() && bias.is_cuda() && addition.is_cuda(),
                "Expected CUDA tensors");
    TORCH_CHECK(x.device() == bias.device() &&
                x.device() == addition.device(), "Device mismatch");
    TORCH_CHECK(x.scalar_type() == at::kFloat &&
                bias.scalar_type() == at::kFloat &&
                addition.scalar_type() == at::kFloat,
                "Expected float32 tensors");
    TORCH_CHECK(x.dim() == 5, "Expected a five-dimensional tensor");
    TORCH_CHECK(bias.is_contiguous() && addition.is_contiguous(),
                "Expected contiguous parameters");
    TORCH_CHECK(bias.numel() == x.size(1) &&
                addition.numel() == x.size(1),
                "Expected one bias and addition value per channel");

    const bool channels_last =
        x.is_contiguous(at::MemoryFormat::ChannelsLast3d);
    TORCH_CHECK(channels_last || x.is_contiguous(),
                "Unsupported tensor layout");

    const c10::cuda::CUDAGuard guard(x.device());
    const cudaStream_t stream =
        c10::cuda::getCurrentCUDAStream(x.get_device()).stream();

    const int64_t count = x.numel();
    if (count == 0) return x;

    const int channels = static_cast<int>(x.size(1));
    const int64_t spatial = x.size(2) * x.size(3) * x.size(4);

    const bool aligned =
        reinterpret_cast<uintptr_t>(x.data_ptr<float>()) % 16 == 0 &&
        reinterpret_cast<uintptr_t>(bias.data_ptr<float>()) % 16 == 0 &&
        reinterpret_cast<uintptr_t>(addition.data_ptr<float>()) % 16 == 0;

    const bool vectorized =
        aligned && (channels_last ? channels % 4 == 0 : spatial % 4 == 0);

    constexpr int threads = 256;
    const int64_t work = vectorized ? count / 4 : count;
    const int blocks = static_cast<int>(
        std::min<int64_t>((work + threads - 1) / threads, 4096));

    if (vectorized && channels_last && channels == 64) {
        activation_64_kernel<<<blocks, threads, 0, stream>>>(
            reinterpret_cast<float4*>(x.data_ptr<float>()),
            reinterpret_cast<const float4*>(bias.data_ptr<float>()),
            reinterpret_cast<const float4*>(addition.data_ptr<float>()),
            work);
    } else if (vectorized && channels_last) {
        activation_vector_kernel<true><<<blocks, threads, 0, stream>>>(
            reinterpret_cast<float4*>(x.data_ptr<float>()),
            bias.data_ptr<float>(), addition.data_ptr<float>(),
            work, spatial, channels);
    } else if (vectorized) {
        activation_vector_kernel<false><<<blocks, threads, 0, stream>>>(
            reinterpret_cast<float4*>(x.data_ptr<float>()),
            bias.data_ptr<float>(), addition.data_ptr<float>(),
            work, spatial, channels);
    } else if (channels_last) {
        activation_scalar_kernel<true><<<blocks, threads, 0, stream>>>(
            x.data_ptr<float>(), bias.data_ptr<float>(),
            addition.data_ptr<float>(), count, spatial, channels);
    } else {
        activation_scalar_kernel<false><<<blocks, threads, 0, stream>>>(
            x.data_ptr<float>(), bias.data_ptr<float>(),
            addition.data_ptr<float>(), count, spatial, channels);
    }

    C10_CUDA_KERNEL_LAUNCH_CHECK();
    return x;
}
"""

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


class ModelNew(nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size, sum_tensor_shape):
        super().__init__()
        self.conv = nn.Conv3d(in_channels, out_channels, kernel_size)
        self.sum_tensor = nn.Parameter(torch.randn(sum_tensor_shape))
        self.conv.to(memory_format=torch.channels_last_3d)

    def forward(self, x):
        use_custom = (
            x.is_cuda
            and x.dtype == torch.float32
            and self.conv.weight.dtype == torch.float32
            and self.conv.bias is not None
            and self.conv.bias.dtype == torch.float32
            and self.sum_tensor.dtype == torch.float32
            and tuple(self.sum_tensor.shape)
            == (self.conv.out_channels, 1, 1, 1)
            and not torch.is_autocast_enabled()
        )

        if use_custom:
            x = x.contiguous(memory_format=torch.channels_last_3d)
            weight = self.conv.weight.contiguous(
                memory_format=torch.channels_last_3d
            )
            x = F.conv3d(
                x,
                weight,
                None,
                self.conv.stride,
                self.conv.padding,
                self.conv.dilation,
                self.conv.groups,
            )
            return _fused_ops.fused_activation_cuda(
                x,
                self.conv.bias.contiguous(),
                self.sum_tensor.contiguous(),
            )

        x = self.conv(x)
        x = F.leaky_relu(x, negative_slope=0.2)
        x = torch.clamp(x + self.sum_tensor, min=-1.0, max=1.0)
        return F.gelu(x)
```