#include <CircleDepthwiseConv2D.h>
Definition at line 25 of file CircleDepthwiseConv2D.h.
◆ validate()
bool luci::CircleDepthwiseConv2DGraphBuilder::validate |
( |
const ValidateArgs & |
args | ) |
const |
|
finalvirtual |
Implements luci::GraphBuilderBase.
Definition at line 26 of file CircleDepthwiseConv2D.cpp.
27{
28
29 if (
args.op.inputs.size() != 3 &&
args.op.inputs.size() != 2)
30 return false;
31
32 if (
args.op.outputs.size() != 1)
33 return false;
34
35 const auto tensors =
args.reader.tensors();
36
37
38 const auto input = tensors.at(
args.op.inputs.at(0));
39 assert(input != nullptr);
40 const auto input_shape =
wrap(
input->shape());
41
42
43 if (input_shape.size() != 4)
44 return false;
45
46
47 const auto filter = tensors.at(
args.op.inputs.at(1));
48 assert(filter != nullptr);
49 const auto filter_shape =
wrap(
filter->shape());
50
51
52 if (filter_shape.size() != 4)
53 return false;
54
55
56 const auto *
options =
args.op.builtin_options.AsDepthwiseConv2DOptions();
57 const auto &multiplier =
options->depth_multiplier;
58
59
60 if (filter_shape.at(3) != input_shape.at(3) * multiplier)
61 return false;
62
63 return true;
64}
VectorWrapper< T > wrap(const flatbuffers::Vector< T > *vec)
References luci::wrap().
The documentation for this class was generated from the following files: