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

#include <CircleReduceAny.h>

Collaboration diagram for luci::CircleReduceAnyGraphBuilder:

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

Member Function Documentation

◆ validate()

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

Implements luci::GraphBuilderBase.

Definition at line 24 of file CircleReduceAny.cpp.

25{
26 if (!GraphBuilder::validate(args, 2))
27 return false;
28
29 const auto &inputs = args.op.inputs;
30 const auto &outputs = args.op.outputs;
31 const auto tensors = args.reader.tensors();
32 const auto tensor_0 = tensors.at(inputs.at(0));
33 const auto tensor_1 = tensors.at(inputs.at(1));
34 const auto tensor_o = tensors.at(outputs[0]);
35 assert(tensor_0 != nullptr);
36 assert(tensor_1 != nullptr);
37 assert(tensor_o != nullptr);
38
39 if (tensor_0->type() != circle::TensorType_BOOL)
40 return false;
41 if (tensor_o->type() != circle::TensorType_BOOL)
42 return false;
43
44 switch (tensor_1->type())
45 {
46 case circle::TensorType_INT32:
47 case circle::TensorType_INT64:
48 break;
49 default:
50 return false;
51 }
52
53 return true;
54}
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: