burn_gdn 0.21.0

Burn-native Gated DeltaNet 2 memory blocks and fused-kernel boundary
Documentation
//! GDN2 chunk-WY fused-kernel bridge.
//!
//! This module is derived from the local `burn_dragon_kernel` GDN2 implementation and keeps the
//! same public executor boundary: projected query/key/value/erase/write/log-decay tensors enter a
//! custom-autodiff chunk-WY path, and unsupported backends return `None` to let callers use the
//! exact reference recurrence.

mod custom_backward;
mod runtime;

pub(crate) use custom_backward::{
    gdn2_chunk_wy_custom_backward_enabled, gdn2_cuda_tensor_core_backward_enabled,
};
pub use custom_backward::{try_gdn2_chunk_wy_custom_backward, try_gdn2_chunk_wy_forward};

pub(crate) fn env_flag(names: &[&str], default: bool) -> bool {
    for name in names {
        let Ok(value) = std::env::var(name) else {
            continue;
        };
        match value.as_str() {
            "1" | "true" | "TRUE" | "on" | "ON" | "yes" | "YES" => return true,
            "0" | "false" | "FALSE" | "off" | "OFF" | "no" | "NO" => return false,
            _ => return default,
        }
    }
    default
}