Write a custom CUDA kernel to optimize `TanhSoft-3` using `float64` (double) precision.

Formula: f(x) = log(1 + exp(x) * tanh(delta * x))

Problem Analysis:
1. Precision Issues with float32: The chain of transcendental functions `exp`, `tanh`, `log` accumulates rounding errors.
2. Memory Bottleneck: The operation is memory-bound, now with 8 bytes per element.

Optimization Strategy: Fused Element-wise Kernel with Double Precision

1. Data Type: All computations are performed in `double`.

2. Vectorized Loads (double2): Use `double2` to load 128 bits (2 double elements) per memory transaction.

3. Fused Stable Math (in double):
   - Clamp input to a safe range for `double` precision `exp` (e.g., 700).
   - Use standard `double` precision math functions (`exp`, `tanh`, `log`).

4. One-Pass: Fuse all logic into a single read-compute-write kernel.
  
Here's an example to show you the syntax of inline embedding custom CUDA operators in torch: The example given architecture is:   
  
```python
import torch
import torch.nn as nn
import torch.nn.functional as F

BATCH_SIZE = 4096
HIDDEN_DIM = 4096
SHAPE = (BATCH_SIZE, HIDDEN_DIM)

DELTA_INIT = 1.0

DTYPE = torch.float64

class TanhSoft3(nn.Module):
    '''
    TanhSoft—Dynamic Trainable Activation Functions for Faster Learning and Better Performance
    https://ieeexplore.ieee.org/document/9514829
    Formula: f(x) = log(1 + exp(x) * tanh(delta * x))
    '''
    def __init__(self, delta_init=1.0):
        super(TanhSoft3, self).__init__()
        self.delta = nn.Parameter(torch.tensor(delta_init, dtype=DTYPE))
        self.clamp_val = 700.0 # for double

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        clamped_x = torch.clamp(x, max=self.clamp_val)
        inner = 1.0 + torch.exp(clamped_x) * torch.tanh(self.delta * x)
        return torch.log(inner.clamp(min=1e-12)) # Epsilon for double

class Model(nn.Module):
    def __init__(self, delta_init=1.0):
        super(Model, self).__init__()
        self.act = TanhSoft3(delta_init)
    
    def forward(self, x):
        return self.act(x)

def get_inputs():
    input_tensor = torch.randn(SHAPE, dtype=DTYPE) * 5.0
    return [input_tensor.contiguous()]

def get_init_inputs():
    return [DELTA_INIT]