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

#include <CircleNonMaxSuppressionV4.h>

Collaboration diagram for luci::CircleNonMaxSuppressionV4GraphBuilder:

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

Member Function Documentation

◆ validate()

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

Implements luci::GraphBuilderBase.

Definition at line 28 of file CircleNonMaxSuppressionV4.cpp.

29{
30 const auto &inputs = args.op.inputs;
31 const auto &outputs = args.op.outputs;
32
33 if (inputs.size() != 5)
34 return false;
35 if (outputs.size() != 2)
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
60 return true;
61}
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: