Graph_optimization with Grappler a SavedModel

Hello, I am trying to optimize a SavedModel following this guide: Google Colab.
I need to apply the “Constant folding optimizer” and I think I should use the tensorflow.python.grappler.tf_optimizer.OptimizeGraph() function.
From the function definition I get that I need the MetaGraph but I don’t know how to obtain this and I don’t know if it is the correct approach.

Please let me know if it is the right procedure.

Thank you

Hi @Francesco_Tosetti

Welcome to the TensorFlow Forum!

Could you please share minimal reproducible code to replicate the error and understand the issue better? Thank you.