Component evidence
Comprehensive activation functions (ReLU, GELU, SiLU, etc.) for the Burn tensor library with math docs.
// Source: https://github.com/tracel-ai/burn | License: Apache-2.0 | Copyright 2022 Nathaniel Simard & Burn Framework Contributors
// Provided via justclaw.it.com; keep this notice with the code.
use burn_backend::ops::ActivationOps;
use burn_dispatch::Dispatch;
use crate::check::TensorCheck;
use crate::check::unwrap_dim_index;
use crate::ops::BridgeTensor;
use crate::{AsIndex, DType, Tensor, check, s};
/// Applies the rectified linear unit function element-wise
/// as described in the paper [Deep Learning using Rectified Linear Units (ReLU)](https://arxiv.org/pdf/1803.08375).
///
#[cfg_attr(doc, doc = "$$\\text{ReLU}\\(x\\) = \\(x\\)^+ = \\max\\(0, x\\)$$")]
#[cfg_attr(not(doc), doc = "`ReLU(x) = max(0, x)`")]
pub fn relu<const D: usize>(tensor: Tensor<D>) -> Tensor<D> {
tensor.relu
... (truncated -- full source via MCP)