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

#include <FloorMod.h>

Collaboration diagram for luci_interpreter::kernels::FloorMod:

Public Member Functions

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

Constructor & Destructor Documentation

◆ FloorMod()

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

Definition at line 48 of file FloorMod.cpp.

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

References x(), and y().

Member Function Documentation

◆ configure()

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

Implements luci_interpreter::Kernel.

Definition at line 50 of file FloorMod.cpp.

51{
52 LUCI_INTERPRETER_CHECK(x()->element_type() == output()->element_type());
53 LUCI_INTERPRETER_CHECK(y()->element_type() == output()->element_type());
54
55 output()->resize(calculateShapeForBroadcast(x()->shape(), y()->shape()));
56}
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(), LUCI_INTERPRETER_CHECK, output(), luci_interpreter::Tensor::resize(), x(), and y().

◆ execute()

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

Implements luci_interpreter::Kernel.

Definition at line 58 of file FloorMod.cpp.

59{
60 switch (x()->element_type())
61 {
62 case DataType::FLOAT32:
63 evalFloat();
64 break;
65 case DataType::S8:
66 evalInteger<int8_t>();
67 break;
68 case DataType::S16:
69 evalInteger<int16_t>();
70 break;
71 case DataType::S32:
72 evalInteger<int32_t>();
73 break;
74 case DataType::S64:
75 evalInteger<int64_t>();
76 break;
77 default:
78 throw std::runtime_error("luci-intp FloorMod Unsupported type.");
79 }
80}

References x().

◆ output()

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

Definition at line 34 of file FloorMod.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::FloorMod::x ( ) const
inline

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

◆ y()

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

Definition at line 33 of file FloorMod.h.

33{ return _inputs[1]; }

References luci_interpreter::Kernel::_inputs.

Referenced by configure(), and FloorMod().


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