ONE - On-device Neural Engine
Loading...
Searching...
No Matches
BatchMatMulV2Chef Class Referencefinal

#include <BatchMatMulV2.h>

Collaboration diagram for BatchMatMulV2Chef:

Public Member Functions

 BatchMatMulV2Chef (const tflchef::Operation *operation)
 
tflite::BuiltinOperator code (void) const override
 
tflite::BuiltinOptions type (void) const override
 
flatbuffers::Offset< void > value (flatbuffers::FlatBufferBuilder &fbb) const override
 
flatbuffers::Offset< flatbuffers::Vector< uint8_t > > custom_value (flatbuffers::FlatBufferBuilder &fbb) const override
 
- Public Member Functions inherited from OpChef
virtual ~OpChef ()=default
 
virtual ~OpChef ()=default
 

Detailed Description

Definition at line 22 of file BatchMatMulV2.h.

Constructor & Destructor Documentation

◆ BatchMatMulV2Chef()

BatchMatMulV2Chef::BatchMatMulV2Chef ( const tflchef::Operation *  operation)
inlineexplicit

Definition at line 25 of file BatchMatMulV2.h.

25 : _operation{operation}
26 {
27 // DO NOTHING
28 }

Member Function Documentation

◆ code()

tflite::BuiltinOperator BatchMatMulV2Chef::code ( void  ) const
inlineoverridevirtual

Implements OpChef.

Definition at line 31 of file BatchMatMulV2.h.

31{ return tflite::BuiltinOperator_CUSTOM; }

◆ custom_value()

flatbuffers::Offset< flatbuffers::Vector< uint8_t > > BatchMatMulV2Chef::custom_value ( flatbuffers::FlatBufferBuilder fbb) const
overridevirtual

REGISTER_OP("BatchMatMulV2") .Input("x: T") .Input("y: T") .Output("output: T") .Attr( "T: {bfloat16, half, float, double, int32, int64, complex64, " "complex128}") .Attr("adj_x: bool = false") .Attr("adj_y: bool = false") .SetShapeFn(shape_inference::BatchMatMulV2Shape);

Reimplemented from OpChef.

Definition at line 29 of file BatchMatMulV2.cpp.

30{
31 auto &operation = (*_operation);
32
33 check_custom_op_value(operation, "BatchMatMulV2");
34
48 auto flex_buffers = std::make_unique<flexbuffers::Builder>();
49 size_t map_start = flex_buffers->StartMap();
50
51 flex_buffers->Bool("adj_x", operation.batch_matmul_options().adj_x());
52 flex_buffers->Bool("adj_y", operation.batch_matmul_options().adj_y());
53 // TODO Support more data types
54 flex_buffers->Int("T", tflite::TensorType_FLOAT32);
55
56 flex_buffers->EndMap(map_start);
57 flex_buffers->Finish();
58
59 auto circle_custom_options = fbb.CreateVector(flex_buffers->GetBuffer());
61}
void check_custom_op_value(const tflchef::Operation &operation, const std::string &op_type)
Definition OpUtils.cpp:21
Offset< Vector< T > > CreateVector(const T *v, size_t len)
Serialize an array into a FlatBuffer vector.
flatbuffers::Offset< flatbuffers::Vector< uint8_t > > circle_custom_options(flatbuffers::FlatBufferBuilder &fb, const luci::CircleNode *node)

References check_custom_op_value(), and flatbuffers::FlatBufferBuilder::CreateVector().

◆ type()

tflite::BuiltinOptions BatchMatMulV2Chef::type ( void  ) const
inlineoverridevirtual

Implements OpChef.

Definition at line 33 of file BatchMatMulV2.h.

33{ return tflite::BuiltinOptions_NONE; }

◆ value()

flatbuffers::Offset< void > BatchMatMulV2Chef::value ( flatbuffers::FlatBufferBuilder fbb) const
overridevirtual

Implements OpChef.

Definition at line 23 of file BatchMatMulV2.cpp.


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