burn-ndarray 0.22.0-pre.1

Ndarray backend for the Burn framework
Documentation
1
2
3
4
5
6
7
8
use crate::{NdArray, execute_with_numeric_dtype, ops::NdArrayMathOps};
use burn_backend::{ElementConversion, TensorMetadata, ops::ActivationOps, tensor::FloatTensor};

impl ActivationOps<Self> for NdArray {
    fn relu(tensor: FloatTensor<Self>) -> FloatTensor<Self> {
        execute_with_numeric_dtype!(tensor, |array| NdArrayMathOps::clamp_min(array, 0.elem()))
    }
}