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

#include <CircleNonMaxSuppressionV5.h>

Collaboration diagram for luci::CircleNonMaxSuppressionV5GraphBuilder:

Public Member Functions

bool validate (const ValidateArgs &args) const final
 
- Public Member Functions inherited from luci::GraphBuilderMultiOutput
virtual ~GraphBuilderMultiOutput ()=default
 
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 CircleNonMaxSuppressionV5.h.

Member Function Documentation

◆ validate()

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

Implements luci::GraphBuilderBase.

Definition at line 28 of file CircleNonMaxSuppressionV5.cpp.

29{
30 const auto &inputs = args.op.inputs;
31 const auto &outputs = args.op.outputs;
32
33 if (inputs.size() != 6)
34 return false;
35 if (outputs.size() != 3)
36 return false;
37
38 const auto tensors = args.reader.tensors();
39 const auto boxes_tensor = tensors.at(inputs[0]);
40 assert(boxes_tensor != nullptr);
41 const auto boxes_tensor_shape = wrap(boxes_tensor->shape());
42 if (boxes_tensor_shape.size() != 2)
43 return false;
44 if (boxes_tensor_shape.at(1) != 4)
45 return false;
46 assert(tensors.at(inputs[1]) != nullptr);
47 if (boxes_tensor_shape.at(0) != wrap(tensors.at(inputs[1])->shape()).at(0))
48 return false;
49
50 assert(tensors.at(inputs[2]) != nullptr);
51 if (tensors.at(inputs[2])->type() != circle::TensorType_INT32)
52 return false;
53 assert(tensors.at(inputs[3]) != nullptr);
54 if (tensors.at(inputs[3])->type() != circle::TensorType_FLOAT32)
55 return false;
56 assert(tensors.at(inputs[4]) != nullptr);
57 if (tensors.at(inputs[4])->type() != circle::TensorType_FLOAT32)
58 return false;
59 assert(tensors.at(inputs[5]) != nullptr);
60 if (tensors.at(inputs[5])->type() != circle::TensorType_FLOAT32)
61 return false;
62
63 return true;
64}
args
Definition infer.py:21
VectorWrapper< T > wrap(const flatbuffers::Vector< T > *vec)

References luci::wrap().


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