26std::vector<int32_t> vector_new_shape(
const tflchef::ReshapeOptions &options)
28 std::vector<int32_t> shapes;
30 for (
int i = 0; i <
options.new_shape_size(); ++i)
32 shapes.push_back(
options.new_shape(i));
42 auto &operation = (*_operation);
44 if (!operation.has_reshape_options())
47 auto options = operation.reshape_options();
48 auto shapes = vector_new_shape(options);
53 tflite::ReshapeOptionsBuilder options_builder{fbb};
55 options_builder.add_new_shape(fb_new_shape);
57 return options_builder.
Finish().Union();
62 return std::unique_ptr<OpChef>{
new ReshapeChef{operation}};
flatbuffers::Offset< void > value(flatbuffers::FlatBufferBuilder &fbb) const override
Helper class to hold data needed in creation of a FlatBuffer. To serialize data, you typically call o...
void Finish(Offset< T > root, const char *file_identifier=nullptr)
Finish serializing a buffer by writing the root offset.
Offset< Vector< T > > CreateVector(const T *v, size_t len)
Serialize an array into a FlatBuffer vector.
std::unique_ptr< OpChef > create(const tflchef::Operation *operation) const override