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

Definition at line 28 of file Sigmoid.cpp.

Member Function Documentation

◆ run()

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

Definition at line 34 of file Sigmoid.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) = 1.0f / (1.0f + std::exp(-arg_accessor.at(index)));
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: