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

#include <CircleTransposeConv.h>

Collaboration diagram for luci::CircleTransposeConvGraphBuilder:

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

Member Function Documentation

◆ validate()

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

Implements luci::GraphBuilderBase.

Definition at line 28 of file CircleTransposeConv.cpp.

29{
30 if (args.op.inputs.size() != 3 && args.op.inputs.size() != 4)
31 return false;
32
33 const auto &inputs = args.op.inputs;
34 const auto tensors = args.reader.tensors();
35 const auto filter_tensor = tensors.at(inputs.at(1));
36 assert(filter_tensor != nullptr);
37 const auto filter_shape = wrap(filter_tensor->shape());
38 const auto ifm_tensor = tensors.at(inputs.at(2));
39 assert(ifm_tensor != nullptr);
40 const auto ifm_shape = wrap(ifm_tensor->shape());
41
42 // ifm and filters must be 4-D tensor
43 if (ifm_shape.size() != 4)
44 return false;
45 if (filter_shape.size() != 4)
46 return false;
47
48 // input shape : [batch, height, width, in_channels]
49 // filters shape : [output_channels, height, weight, in_channels]
50 if (ifm_shape.at(3) != filter_shape.at(3))
51 return false;
52
53 return true;
54}
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: