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

#include <GreaterEqual.h>

Collaboration diagram for luci_interpreter::kernels::GreaterEqual:

Public Member Functions

 GreaterEqual (const Tensor *x, const Tensor *y, Tensor *output)
 
const Tensorx () const
 
const Tensory () 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 27 of file GreaterEqual.h.

Constructor & Destructor Documentation

◆ GreaterEqual()

luci_interpreter::kernels::GreaterEqual::GreaterEqual ( const Tensor x,
const Tensor y,
Tensor output 
)

Definition at line 30 of file GreaterEqual.cpp.

31 : Kernel({x, y}, {output})
32{
33}
Kernel(std::vector< const Tensor * > inputs, std::vector< Tensor * > outputs)
Definition Kernel.h:31

References x(), and y().

Member Function Documentation

◆ configure()

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

Implements luci_interpreter::Kernel.

Definition at line 35 of file GreaterEqual.cpp.

36{
37 LUCI_INTERPRETER_CHECK(x()->element_type() == y()->element_type());
38 LUCI_INTERPRETER_CHECK(output()->element_type() == DataType::BOOL);
39
40 if (x()->element_type() == DataType::U8)
41 {
42 quantizeMultiplierSmallerThanOneExp(x()->scale(), &_x_multiplier, &_x_shift);
43 quantizeMultiplierSmallerThanOneExp(y()->scale(), &_y_multiplier, &_y_shift);
44 }
45 output()->resize(calculateShapeForBroadcast(x()->shape(), y()->shape()));
46}
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
void quantizeMultiplierSmallerThanOneExp(double double_multiplier, int32_t *quantized_multiplier, int *left_shift)
Definition Utils.cpp:193

References luci_interpreter::kernels::calculateShapeForBroadcast(), LUCI_INTERPRETER_CHECK, output(), luci_interpreter::kernels::quantizeMultiplierSmallerThanOneExp(), luci_interpreter::Tensor::resize(), x(), and y().

◆ execute()

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

Implements luci_interpreter::Kernel.

Definition at line 48 of file GreaterEqual.cpp.

49{
50 switch (x()->element_type())
51 {
52 case DataType::FLOAT32:
53 evalFloat();
54 break;
55 case DataType::S64:
56 evalInteger<int64_t>();
57 break;
58 case DataType::S32:
59 evalInteger<int32_t>();
60 break;
61 case DataType::U8:
62 evalQuantized();
63 break;
64 default:
65 throw std::runtime_error("luci-intp GreaterEqual Unsupported type.");
66 }
67}

References x().

◆ output()

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

Definition at line 34 of file GreaterEqual.h.

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

References luci_interpreter::Kernel::_outputs.

Referenced by configure().

◆ x()

const Tensor * luci_interpreter::kernels::GreaterEqual::x ( ) const
inline

Definition at line 32 of file GreaterEqual.h.

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

References luci_interpreter::Kernel::_inputs.

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

◆ y()

const Tensor * luci_interpreter::kernels::GreaterEqual::y ( ) const
inline

Definition at line 33 of file GreaterEqual.h.

33{ return _inputs[1]; }

References luci_interpreter::Kernel::_inputs.

Referenced by configure(), and GreaterEqual().


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