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

#include <FloorDiv.h>

Collaboration diagram for luci_interpreter::kernels::FloorDiv:

Public Member Functions

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

Constructor & Destructor Documentation

◆ FloorDiv()

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

Definition at line 30 of file FloorDiv.cpp.

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

Member Function Documentation

◆ configure()

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

Implements luci_interpreter::Kernel.

Definition at line 35 of file FloorDiv.cpp.

36{
37 LUCI_INTERPRETER_CHECK(x()->element_type() == output()->element_type());
38 LUCI_INTERPRETER_CHECK(y()->element_type() == output()->element_type());
39
40 output()->resize(calculateShapeForBroadcast(x()->shape(), y()->shape()));
41}
void resize(const Shape &new_shape)
Definition Tensor.cpp:56
const Tensor * y() const
Definition FloorDiv.h:33
const Tensor * x() const
Definition FloorDiv.h:32
#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::FloorDiv::execute ( ) const
overridevirtual

Implements luci_interpreter::Kernel.

Definition at line 43 of file FloorDiv.cpp.

44{
45 switch (x()->element_type())
46 {
47 case DataType::FLOAT32:
48 evalFloat();
49 break;
50 default:
51 throw std::runtime_error("luci-intp FloorDiv Unsupported type.");
52 }
53}

References x().

◆ output()

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

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

Definition at line 32 of file FloorDiv.h.

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

References luci_interpreter::Kernel::_inputs.

Referenced by configure(), and execute().

◆ y()

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

Definition at line 33 of file FloorDiv.h.

33{ return _inputs[1]; }

References luci_interpreter::Kernel::_inputs.

Referenced by configure().


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