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

Static Public Member Functions

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

Detailed Description

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

Definition at line 28 of file ReLU.cpp.

Member Function Documentation

◆ run()

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

Definition at line 34 of file ReLU.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 res_accessor.at(index) = std::max(arg_accessor.at(index), static_cast<T>(0));
42 }
43}
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: