[英]TF_SessionRun of TensorFlow C API cannot run a session created in another member function
[英]How to get TF_Input from TF_Operation using C api of Tensorflow?
我正在使用 Tensorflow 1.13.1 的 C-API。
通過TF_GraphOperationByName獲取TF_Operation后,我找不到獲取TF_Input或TF_Output的方法,我想獲取其中的數據類型。
下面是相關的方法( https://github.com/tensorflow/tensorflow/blob/r1.13/tensorflow/c/c_api.h )
TF_CAPI_EXPORT extern int TF_OperationNumInputs(TF_Operation* oper);
TF_CAPI_EXPORT extern TF_DataType TF_OperationInputType(TF_Input oper_in);
在我看來,它缺少像“TF_Input TF_OperationInput(int32_t index);”這樣的方法
TF_Operation *input_op = TF_GraphOperationByName(graph, "Placeholder");
int input_num = TF_OperationNumInputs(input_op);
for (int i = 0; i < input_num; ++i) {
// Expectation: auto oper_in = TF_OperationInput(i);
auto data_type = TF_OperationInputType(oper_in);
}
請幫助我找到從每個 TF_Input 和 TF_Output 中獲取 TF_Datatype 的方法。
非常感謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.