nn.softplus
fn softplus(tensor: @Tensor<T>) -> Tensor<T>;Args
Returns
Type Constraints
Examples
use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor, FP8x23};
use orion::operators::nn::{NNTrait, FP8x23NN};
use orion::numbers::{FP8x23, FixedTrait};
fn softplus_example() -> Tensor<FP8x23> {
let tensor = TensorTrait::<FP8x23>::new(
shape: array![2, 2].span(),
data: array![
FixedTrait::new(0, false),
FixedTrait::new(1, false),
FixedTrait::new(2, false),
FixedTrait::new(3, false),
]
.span(),
);
return NNTrait::softplus(@tensor);
}
>>> [[5814540,11016447],[17841964,25573406]]
// The fixed point representation of
// [[0.6931452, 1.31326096],[2.12692796, 3.04858728]]Last updated