ONE - On-device Neural Engine
Loading...
Searching...
No Matches
luci::CircleRoundGraphBuilder Class Reference

#include <CircleRound.h>

Collaboration diagram for luci::CircleRoundGraphBuilder:

Public Member Functions

bool validate (const ValidateArgs &args) const final
 
- Public Member Functions inherited from luci::GraphBuilder
virtual ~GraphBuilder ()=default
 
bool validate (const ValidateArgs &args, size_t input_cnt) const
 
CircleNodebuild (const circle::OperatorT &op, GraphBuilderContext *context) const final
 
- Public Member Functions inherited from luci::GraphBuilderBase
virtual ~GraphBuilderBase ()=default
 

Detailed Description

Definition at line 25 of file CircleRound.h.

Member Function Documentation

◆ validate()

bool luci::CircleRoundGraphBuilder::validate ( const ValidateArgs args) const
finalvirtual

Implements luci::GraphBuilderBase.

Definition at line 26 of file CircleRound.cpp.

27{
28 if (!GraphBuilder::validate(args, 1))
29 return false;
30
31 const auto &inputs = args.op.inputs;
32 const auto &outputs = args.op.outputs;
33 // Must be one of the following types
34 // bfloat16, half (float16), float32, float64, complex64, complex128
35 // Currently, circle supports float16, float32, complex64
36 const auto tensors = args.reader.tensors();
37 const auto tensor_in = tensors.at(inputs.at(0));
38 const auto tensor_out = tensors.at(outputs[0]);
39 assert(tensor_in != nullptr);
40 assert(tensor_out != nullptr);
41
42 switch (tensor_in->type())
43 {
44 case circle::TensorType_FLOAT16:
45 case circle::TensorType_FLOAT32:
46 case circle::TensorType_FLOAT64:
47 case circle::TensorType_INT32:
48 case circle::TensorType_INT64:
49 break;
50 default:
51 return false;
52 }
53
54 if (tensor_out->type() != tensor_in->type())
55 return false;
56
57 return true;
58}
bool validate(const ValidateArgs &args, size_t input_cnt) const
args
Definition infer.py:21

References luci::GraphBuilder::validate().


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