ONE - On-device Neural Engine
Loading...
Searching...
No Matches
mir_interpreter::LeakyReLUImpl< 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::LeakyReLUImpl< T >

Definition at line 26 of file LeakyReLU.cpp.

Member Function Documentation

◆ run()

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

Definition at line 32 of file LeakyReLU.cpp.

33{
34 mir::Tensor<T> arg_accessor(arg);
35 mir::Tensor<T> res_accessor(result);
36
37 for (const auto &index : mir::ShapeRange(result.getShape()))
38 {
39 auto x = arg_accessor.at(index);
40 res_accessor.at(index) = x < 0 ? x * alpha : x;
41 }
42}
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: