ONE - On-device Neural Engine
Loading...
Searching...
No Matches
mir_interpreter::ELUImpl< T > Struct Template Reference

Static Public Member Functions

static void run (const mir::TensorVariant &arg, float alpha, mir::TensorVariant &result)
 

Detailed Description

template<typename T>
struct mir_interpreter::ELUImpl< T >

Definition at line 28 of file ELU.cpp.

Member Function Documentation

◆ run()

template<typename T >
void mir_interpreter::ELUImpl< T >::run ( const mir::TensorVariant arg,
float  alpha,
mir::TensorVariant result 
)
static

Definition at line 34 of file ELU.cpp.

35{
36 mir::Tensor<T> arg_accessor(arg);
37 mir::Tensor<T> res_accessor(result);
38
39 for (const auto &index : mir::ShapeRange(result.getShape()))
40 {
41 const T x = arg_accessor.at(index);
42 res_accessor.at(index) = x < 0 ? alpha * (std::exp(x) - 1) : x;
43 }
44}
result
Definition infer.py:103
nnfw::cker::Shape getShape(const IPortableTensor *tensor)

References mir::Tensor< T >::at().

Referenced by package.infer.session::inference().


The documentation for this struct was generated from the following file: