#include <CircleOneHot.h>
Definition at line 25 of file CircleOneHot.h.
◆ validate()
bool luci::CircleOneHotGraphBuilder::validate |
( |
const ValidateArgs & |
args | ) |
const |
|
finalvirtual |
Implements luci::GraphBuilderBase.
Definition at line 27 of file CircleOneHot.cpp.
28{
29
31 return false;
32
34 const auto *
options =
args.op.builtin_options.AsOneHotOptions();
35 const auto tensors =
args.reader.tensors();
36 const auto indices = tensors.at(
inputs.at(0));
37 const auto depth = tensors.at(
inputs.at(1));
38 const auto on_value = tensors.at(
inputs.at(2));
39 const auto off_value = tensors.at(
inputs.at(3));
40 assert(indices != nullptr);
41 assert(depth != nullptr);
42 assert(on_value != nullptr);
43 assert(off_value != nullptr);
44
45 if (
options->axis < -1 ||
options->axis >
static_cast<int32_t
>(
wrap(indices->shape()).size()))
46 return false;
47 if (
wrap(depth->shape()).size() != 0)
48 return false;
49 if (
wrap(on_value->shape()).size() != 0)
50 return false;
51 if (
wrap(off_value->shape()).size() != 0)
52 return false;
53 if (on_value->type() != off_value->type())
54 return false;
55
56 return true;
57}
bool validate(const ValidateArgs &args, size_t input_cnt) const
VectorWrapper< T > wrap(const flatbuffers::Vector< T > *vec)
References luci::GraphBuilder::validate(), and luci::wrap().
The documentation for this class was generated from the following files: