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

#include <CircleReshape.h>

Collaboration diagram for luci::CircleReshapeGraphBuilder:

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

Member Function Documentation

◆ validate()

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

Implements luci::GraphBuilderBase.

Definition at line 25 of file CircleReshape.cpp.

26{
27 if (args.op.inputs.size() != 1 && args.op.inputs.size() != 2)
28 return false;
29
30 if (args.op.outputs.size() != 1)
31 return false;
32
33 // for two inputs, check if type is S32 or S64
34 if (args.op.inputs.size() == 2)
35 {
36 const auto &inputs = args.op.inputs;
37 const auto tensors = args.reader.tensors();
38 const auto tensor_in = tensors.at(inputs.at(1));
39 assert(tensor_in != nullptr);
40
41 if (tensor_in->type() != circle::TensorType::TensorType_INT32 &&
42 tensor_in->type() != circle::TensorType::TensorType_INT64)
43 return false;
44 }
45
46 return true;
47}
args
Definition infer.py:21

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