-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tflchef] Support multiple subgraphs #12506
Comments
from #12516 (comment) about the changes1/ all the 2/ requirements to support multiple sub-graph in recipe generation1/ support adding new Op in what I can think of ...as-is tflchef::Operation *
build(const tflite::Operator *op, TFliteImport *import, tflchef::ModelRecipe *model_recipe) const is called from if (const auto *graph_builder = TFliteOpRegistry::get().lookup(builtincode))
{
auto operation = graph_builder->build(op, &tflite_import, model_recipe.get()); prop 1: replace with new context class tflchef::Operation *
build(const tflite::Operator *op, ChefContext *cctx) const
{
auto operation = cctcx->add_operation(); prop 2: create void
build(const tflite::Operator *op, tflchef::Operation *op) const call from if (const auto *graph_builder = TFliteOpRegistry::get().lookup(builtincode))
{
tflchef::Operation *operation = graph ? graph->add_operation() : model_recipe.add_operation();
graph_builder->build(op, operation); prop 3: ... will update if any other comes up |
There are two things that I came up with.
message Graph {
repeated Operand operand = 1;
repeated Operation operation = 2;
repeated string input = 3;
repeated string output = 4;
optional string name = 5;
}
message ModelRecipe {
optional uint32 version = 1 [default = 1];
repeated Graph graph = 2;
repeated SignatureDef signature_def = 3;
}
Since |
This will require all existing recipe files to be updated to follow the schema... |
I prefer this second variant, anyway, I can do any of them. Which one should I choose? |
first idea using mixing them would be like prop 3; struct RecipeChefContext {
tflite::Operator *tflop = nullptr;
tflchef::Operation *chefop = nullptr;
// add more if needed
};
void build(RecipeChefContext *ctx) const |
Thanks for accepting my proposal and for laborious update! |
thank you @seanshpark! |
What
Let's support multiple subgraphs in
tflchef-reverse
Why
To generate recipes for tflite models with multiple subgraphs (for example for #12319 (comment))
The text was updated successfully, but these errors were encountered: