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

#include <LogicalOr.h>

Collaboration diagram for luci_interpreter::kernels::LogicalOr:

Public Member Functions

 LogicalOr (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 LogicalOr.h.

Constructor & Destructor Documentation

◆ LogicalOr()

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

Definition at line 28 of file LogicalOr.cpp.

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

References input1(), and input2().

Member Function Documentation

◆ configure()

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

Implements luci_interpreter::Kernel.

Definition at line 33 of file LogicalOr.cpp.

34{
35 LUCI_INTERPRETER_CHECK(input1()->element_type() == input2()->element_type());
36 LUCI_INTERPRETER_CHECK(input1()->element_type() == DataType::BOOL);
37 output()->resize(calculateShapeForBroadcast(input1()->shape(), input2()->shape()));
38}
void resize(const Shape &new_shape)
Definition Tensor.cpp:56
#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::LogicalOr::execute ( ) const
overridevirtual

Implements luci_interpreter::Kernel.

Definition at line 40 of file LogicalOr.cpp.

41{
42 BinaryOpBroadcastSlow(getTensorShape(input1()), getTensorData<bool>(input1()),
43 getTensorShape(input2()), getTensorData<bool>(input2()),
44 getTensorShape(output()), getTensorData<bool>(output()),
45 [](bool x, bool y) { return x || y; });
46}
tflite::RuntimeShape getTensorShape(const Tensor *tensor)
Definition Utils.h:194
void BinaryOpBroadcastSlow(const tflite::RuntimeShape &unextended_input1_shape, const T *input1_data, const tflite::RuntimeShape &unextended_input2_shape, const T *input2_data, const tflite::RuntimeShape &unextended_output_shape, T *output_data, Op op)

References luci_interpreter::kernels::BinaryOpBroadcastSlow(), luci_interpreter::kernels::getTensorShape(), input1(), input2(), and output().

◆ input1()

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

Definition at line 33 of file LogicalOr.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 LogicalOr().

◆ input2()

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

Definition at line 34 of file LogicalOr.h.

34{ return _inputs[1]; }

References luci_interpreter::Kernel::_inputs.

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

◆ output()

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

Definition at line 35 of file LogicalOr.h.

35{ 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: