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

#include <LogicalAnd.h>

Collaboration diagram for luci_interpreter::kernels::LogicalAnd:

Public Member Functions

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

Constructor & Destructor Documentation

◆ LogicalAnd()

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

Definition at line 29 of file LogicalAnd.cpp.

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

References input1(), and input2().

Member Function Documentation

◆ configure()

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

Implements luci_interpreter::Kernel.

Definition at line 34 of file LogicalAnd.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}
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::LogicalAnd::execute ( ) const
overridevirtual

Implements luci_interpreter::Kernel.

Definition at line 41 of file LogicalAnd.cpp.

42{
43 switch (input1()->element_type())
44 {
45 case DataType::BOOL:
46 evalLogicalAnd();
47 break;
48 default:
49 throw std::runtime_error("luci-intp LogicalAnd Unsupported type.");
50 }
51}

References input1().

◆ input1()

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

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

◆ input2()

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

Definition at line 34 of file LogicalAnd.h.

34{ return _inputs[1]; }

References luci_interpreter::Kernel::_inputs.

Referenced by configure(), and LogicalAnd().

◆ output()

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

Definition at line 35 of file LogicalAnd.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: