37 const auto &inputs = args.op.inputs;
38 const auto &outputs = args.op.outputs;
39 const auto *options = args.op.builtin_options.AsUnpackOptions();
41 if (inputs.size() != 1)
45 if (
static_cast<int32_t
>(outputs.size()) != options->num)
49 const auto tensors = args.reader.tensors();
50 const auto output_tensor = tensors[outputs[0]];
52 WARN(l) <<
"Warning: import Unpack(" << name <<
") 'num' is not same as outputs used";
61 const auto tensors = args.reader.tensors();
62 const auto tensor = tensors.at(inputs.at(0));
63 assert(tensor !=
nullptr);
64 const auto shape =
wrap(tensor->shape());
65 auto shape_size =
static_cast<int32_t
>(shape.size());
69 if (options->axis < -shape_size || options->axis >= shape_size)
92CircleNode *CircleUnpackGraphBuilder::build_node(
const BuildNodeArgs &bna)
const
96 node->
value(bna.input_nodes[0]);
98 const auto *options = bna.op.builtin_options.AsUnpackOptions();
99 node->num(options->num);
100 node->axis(options->axis);
105CircleNode *CircleUnpackGraphBuilder::build_out(
const BuildOutArgs &boa)
const
107 auto *nodeout = boa.node->graph()->nodes()->create<CircleUnpackOut>();
109 nodeout->input(boa.node);
110 nodeout->index(boa.index);
NodeContext * nodes(void)
Derived * create(Args &&...args)
bool validate(const ValidateArgs &args) const final
loco::Node * value(void) const
const char * tensor_name(const circle::Tensor *tensor)
VectorWrapper< T > wrap(const flatbuffers::Vector< T > *vec)
static UserSettings * settings()