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

Static Public Member Functions

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

Detailed Description

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

Definition at line 30 of file CappedReLU.cpp.

Member Function Documentation

◆ run()

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

Definition at line 36 of file CappedReLU.cpp.

37{
38 mir::Tensor<T> arg_accessor(arg);
39 mir::Tensor<T> res_accessor(result);
40
41 for (const auto &index : mir::ShapeRange(result.getShape()))
42 {
43 res_accessor.at(index) = std::min(std::max(arg_accessor.at(index), T(0)), static_cast<T>(cap));
44 }
45}
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: