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

#include <Minimum.h>

Collaboration diagram for luci_interpreter::kernels::Minimum:

Public Member Functions

 Minimum (const Tensor *input1, const Tensor *input2, Tensor *output)
 
const Tensorinput1 () const
 
const Tensorinput2 () 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 Minimum.h.

Constructor & Destructor Documentation

◆ Minimum()

luci_interpreter::kernels::Minimum::Minimum ( const Tensor input1,
const Tensor input2,
Tensor output 
)

Definition at line 29 of file Minimum.cpp.

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

References input1(), and input2().

Member Function Documentation

◆ configure()

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

Implements luci_interpreter::Kernel.

Definition at line 34 of file Minimum.cpp.

35{
36 LUCI_INTERPRETER_CHECK(input1()->element_type() == input2()->element_type())
37 LUCI_INTERPRETER_CHECK(input1()->element_type() == output()->element_type())
38 output()->resize(calculateShapeForBroadcast(input1()->shape(), input2()->shape()));
39}
#define LUCI_INTERPRETER_CHECK(cond)
Definition Utils.h:36
Shape calculateShapeForBroadcast(const Shape &input1_shape, const Shape &input2_shape)
Definition Utils.cpp:204

References luci_interpreter::kernels::calculateShapeForBroadcast(), input1(), input2(), LUCI_INTERPRETER_CHECK, output(), and luci_interpreter::Tensor::resize().

◆ execute()

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

Implements luci_interpreter::Kernel.

Definition at line 41 of file Minimum.cpp.

42{
43 switch (input1()->element_type())
44 {
45 case DataType::FLOAT32:
46 evalMinimum<float>();
47 break;
48 case DataType::U8:
49 evalMinimum<uint8_t>();
50 break;
51 default:
52 throw std::runtime_error("luci-intp Minimum Unsupported type.");
53 }
54}

References input1().

◆ input1()

const Tensor * luci_interpreter::kernels::Minimum::input1 ( ) const
inline

Definition at line 33 of file Minimum.h.

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

References luci_interpreter::Kernel::_inputs.

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

◆ input2()

const Tensor * luci_interpreter::kernels::Minimum::input2 ( ) const
inline

Definition at line 34 of file Minimum.h.

34{ return _inputs[1]; }

References luci_interpreter::Kernel::_inputs.

Referenced by configure(), and Minimum().

◆ output()

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

Definition at line 35 of file Minimum.h.

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

References luci_interpreter::Kernel::_outputs.

Referenced by configure().


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