'TensorFlow: How to get the meta data from a model with c_api?

With Saved_Model_CLI you can read out the name, id, shape and datatype of the input and output tensor.

How do you do it with the c_api? I can load a session (and graph), construct input and output tensor and run the session, but for the moment I have to hardcode these meta data.

If possible, no additional libs and just with the c_api. If it is not possible with only the c_api, than please show me an alternative.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source