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

#include <CircleWhere.h>

Collaboration diagram for luci::CircleWhereGraphBuilder:

Public Member Functions

bool validate (const ValidateArgs &args) const final
 
CircleNodebuild_node (const circle::OperatorT &op, const std::vector< CircleNode * > &inputs, loco::Graph *graph) const override
 
- 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 CircleWhere.h.

Member Function Documentation

◆ build_node()

CircleNode * luci::CircleWhereGraphBuilder::build_node ( const circle::OperatorT &  op,
const std::vector< CircleNode * > &  inputs,
loco::Graph graph 
) const
overridevirtual

Implements luci::GraphBuilder.

Definition at line 48 of file CircleWhere.cpp.

51{
52 auto *node = graph->nodes()->create<CircleWhere>();
53 node->condition(inputs.at(0));
54
55 return node;
56}

References luci::CircleWhere::condition().

◆ validate()

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

Implements luci::GraphBuilderBase.

Definition at line 26 of file CircleWhere.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 const auto tensors = args.reader.tensors();
34 const auto tensor_condition = tensors.at(inputs.at(0));
35 const auto tensor_out = tensors.at(outputs[0]);
36 assert(tensor_condition != nullptr);
37 assert(tensor_out != nullptr);
38
39 if (tensor_condition->type() != circle::TensorType_BOOL)
40 return false;
41
42 if (tensor_out->type() != circle::TensorType_INT64)
43 return false;
44
45 return true;
46}
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: