ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::cpu::ops::RoPELayer Class Reference

#include <RoPELayer.h>

Collaboration diagram for onert::backend::cpu::ops::RoPELayer:

Public Member Functions

 RoPELayer ()
 
 ~RoPELayer ()
 
void configure (const IPortableTensor *input, const IPortableTensor *sin, const IPortableTensor *cos, const nnfw::cker::RoPEMode mode, IPortableTensor *output)
 
void run () override
 
- Public Member Functions inherited from onert::exec::IFunction
virtual ~IFunction ()=default
 
virtual void prepare ()
 

Detailed Description

Definition at line 34 of file RoPELayer.h.

Constructor & Destructor Documentation

◆ RoPELayer()

onert::backend::cpu::ops::RoPELayer::RoPELayer ( )

Definition at line 30 of file RoPELayer.cc.

31 : _input(nullptr), _sin(nullptr), _cos(nullptr), _mode(nnfw::cker::RoPEMode::kGptNeox),
32 _output(nullptr)
33{
34 // DO NOTHING
35}

◆ ~RoPELayer()

onert::backend::cpu::ops::RoPELayer::~RoPELayer ( )
default

Member Function Documentation

◆ configure()

void onert::backend::cpu::ops::RoPELayer::configure ( const IPortableTensor input,
const IPortableTensor sin,
const IPortableTensor cos,
const nnfw::cker::RoPEMode  mode,
IPortableTensor output 
)

Definition at line 39 of file RoPELayer.cc.

42{
43 assert(input != nullptr);
44 assert(sin != nullptr);
45 assert(cos != nullptr);
46 assert(output != nullptr);
47
48 _input = input;
49 _sin = sin;
50 _cos = cos;
51 _mode = mode;
52 _output = output;
53}

◆ run()

void onert::backend::cpu::ops::RoPELayer::run ( )
overridevirtual

Implements onert::exec::IFunction.

Definition at line 65 of file RoPELayer.cc.

66{
67 switch (_input->data_type())
68 {
69 case OperandType::FLOAT32:
70 rope<float>();
71 break;
72 case OperandType::INT32:
73 rope<int32_t>();
74 break;
75 case OperandType::INT64:
76 rope<int64_t>();
77 break;
78 case OperandType::QUANT_UINT8_ASYMM:
79 rope<uint8_t>();
80 break;
81 case OperandType::QUANT_INT8_ASYMM:
82 rope<int8_t>();
83 break;
84 default:
85 throw std::runtime_error("RoPE: unsupported data type");
86 }
87}
ir::DataType data_type() const override final

References onert::backend::IPortableTensor::data_type().

Referenced by package.infer.session::inference().


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