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

#include <CircleGreater.h>

Collaboration diagram for luci::CircleGreaterGraphBuilder:

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 CircleGreater.h.

Member Function Documentation

◆ validate()

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

Implements luci::GraphBuilderBase.

Definition at line 29 of file CircleGreater.cpp.

30{
31 LOGGER(l);
32
33 if (!GraphBuilder::validate(args, 2))
34 return false;
35
36 auto settings = luci::UserSettings::settings();
37
38 const auto &inputs = args.op.inputs;
39 const auto &outputs = args.op.outputs;
40 const auto tensors = args.reader.tensors();
41
42 assert(tensors[inputs.at(0)] != nullptr && tensors[inputs.at(1)] != nullptr);
43 if (tensors[inputs.at(0)]->type() != tensors[inputs.at(1)]->type())
44 return false;
45
46 // NOTE: real models do have output dtype NOT BOOL
47 assert(tensors[outputs[0]] != nullptr);
48 if (tensors[outputs[0]]->type() != circle::TensorType_BOOL)
49 {
51 {
52 const auto output_tensor = tensors[outputs[0]];
53 auto name = tensor_name(output_tensor);
54 WARN(l) << "Warning: import Greater(" << name << ") output dtype is not boolean";
55 }
56 else
57 return false;
58 }
59
60 return true;
61}
#define LOGGER(name)
Definition Log.h:65
bool validate(const ValidateArgs &args, size_t input_cnt) const
#define WARN(name)
Definition Log.h:70
args
Definition infer.py:21
type
Definition infer.py:18
const char * tensor_name(const circle::Tensor *tensor)
static UserSettings * settings()

References luci::UserSettings::DisableValidation, LOGGER, luci::UserSettings::settings(), luci::tensor_name(), luci::GraphBuilder::validate(), and WARN.


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