ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci_interpreter::kernels::Elu Class Reference

#include <Elu.h>

Collaboration diagram for luci_interpreter::kernels::Elu:

Public Member Functions

 Elu (const Tensor *input, Tensor *output)
 
const Tensorinput () const
 
Tensoroutput () const
 
void configure () override
 
void execute () const override
 
- Public Member Functions inherited from luci_interpreter::Kernel
virtual ~Kernel ()=default
 
const std::vector< const Tensor * > & getInputTensors () const
 
const std::vector< Tensor * > & getOutputTensors () const
 

Additional Inherited Members

- Protected Member Functions inherited from luci_interpreter::Kernel
 Kernel (std::vector< const Tensor * > inputs, std::vector< Tensor * > outputs)
 
- Protected Attributes inherited from luci_interpreter::Kernel
const std::vector< const Tensor * > _inputs
 
const std::vector< Tensor * > _outputs
 

Detailed Description

Definition at line 28 of file Elu.h.

Constructor & Destructor Documentation

◆ Elu()

luci_interpreter::kernels::Elu::Elu ( const Tensor input,
Tensor output 
)

Definition at line 30 of file Elu.cpp.

30: Kernel({input}, {output}) {}
Kernel(std::vector< const Tensor * > inputs, std::vector< Tensor * > outputs)
Definition Kernel.h:31
Tensor * output() const
Definition Elu.h:34
const Tensor * input() const
Definition Elu.h:33

References input().

Member Function Documentation

◆ configure()

void luci_interpreter::kernels::Elu::configure ( )
overridevirtual

Implements luci_interpreter::Kernel.

Definition at line 32 of file Elu.cpp.

33{
34 LUCI_INTERPRETER_CHECK(input()->element_type() == output()->element_type());
35 output()->resize(input()->shape());
36}
void resize(const Shape &new_shape)
Definition Tensor.cpp:56
#define LUCI_INTERPRETER_CHECK(cond)
Definition Utils.h:36

References input(), LUCI_INTERPRETER_CHECK, output(), and luci_interpreter::Tensor::resize().

◆ execute()

void luci_interpreter::kernels::Elu::execute ( ) const
overridevirtual

Implements luci_interpreter::Kernel.

Definition at line 38 of file Elu.cpp.

39{
40 switch (input()->element_type())
41 {
42 case DataType::FLOAT32:
43 luci_interpreter_pal::Elu(getTensorShape(input()), getTensorData<float>(input()),
44 getTensorShape(output()), getTensorData<float>(output()));
45 break;
46 default:
47 throw std::runtime_error("luci-intp Elu Unsupported type.");
48 }
49}
tflite::RuntimeShape getTensorShape(const Tensor *tensor)
Definition Utils.h:194

References luci_interpreter::kernels::getTensorShape(), input(), and output().

◆ input()

const Tensor * luci_interpreter::kernels::Elu::input ( ) const
inline

Definition at line 33 of file Elu.h.

33{ return _inputs[0]; }
const std::vector< const Tensor * > _inputs
Definition Kernel.h:52

References luci_interpreter::Kernel::_inputs.

Referenced by configure(), Elu(), and execute().

◆ output()

Tensor * luci_interpreter::kernels::Elu::output ( ) const
inline

Definition at line 34 of file Elu.h.

34{ return _outputs[0]; }
const std::vector< Tensor * > _outputs
Definition Kernel.h:53

References luci_interpreter::Kernel::_outputs.

Referenced by configure(), and execute().


The documentation for this class was generated from the following files: