#include <CircleCast.h>
Definition at line 25 of file CircleCast.h.
◆ validate()
bool luci::CircleCastGraphBuilder::validate |
( |
const ValidateArgs & |
args | ) |
const |
|
finalvirtual |
Implements luci::GraphBuilderBase.
Definition at line 29 of file CircleCast.cpp.
30{
32
34 return false;
35
37
39 const auto &outputs =
args.op.outputs;
40
41
42 const auto *
options =
args.op.builtin_options.AsCastOptions();
43 if (options != nullptr)
44 {
45 const auto tensors =
args.reader.tensors();
47 assert(output_tensor != nullptr);
49
50 const auto tensor_in = tensors.at(
inputs.at(0));
51 assert(tensor_in != nullptr);
52 if (tensor_in->type() !=
options->in_data_type)
53 {
55 {
56 WARN(l) <<
"Warning: import Cast(" << name <<
") dtype mismatch";
57 }
58 else
59 return false;
60 }
61 const auto &tensor_out = tensors.at(outputs[0]);
62 if (tensor_out->type() !=
options->out_data_type)
63 {
65 {
66 WARN(l) <<
"Warning: import Cast(" << name <<
") dtype mismatch";
67 }
68 else
69 return false;
70 }
71 }
72
73 return true;
74}
bool validate(const ValidateArgs &args, size_t input_cnt) const
const char * tensor_name(const circle::Tensor *tensor)
static UserSettings * settings()
References luci::UserSettings::DisableValidation, LOGGER, luci::UserSettings::settings(), luci::tensor_name(), luci::GraphBuilder::validate(), and WARN.
The documentation for this class was generated from the following files: