RunInitOp will return OK if the initialization op was run successfully. An empty init_op_name indicates that there are no init ops to run.
| 366 | // RunInitOp will return OK if the initialization op was run successfully. |
| 367 | // An empty init_op_name indicates that there are no init ops to run. |
| 368 | Status RunInitOp(const RunOptions& run_options, const string& export_dir, |
| 369 | const MetaGraphDef& meta_graph_def, |
| 370 | const std::vector<AssetFileDef>& asset_file_defs, |
| 371 | Session* session, const string& init_op_name) { |
| 372 | if (!init_op_name.empty()) { |
| 373 | LOG(INFO) << "Running initialization op on SavedModel bundle at path: " |
| 374 | << export_dir; |
| 375 | std::vector<std::pair<string, Tensor>> inputs; |
| 376 | AddAssetsTensorsToInputs(export_dir, asset_file_defs, &inputs); |
| 377 | RunMetadata run_metadata; |
| 378 | return RunOnce(run_options, inputs, {}, {init_op_name}, |
| 379 | nullptr /* outputs */, &run_metadata, session); |
| 380 | } |
| 381 | return Status::OK(); |
| 382 | } |
| 383 | |
| 384 | Status GetInitOp(const string& export_dir, const MetaGraphDef& meta_graph_def, |
| 385 | string* init_op_name) { |
no test coverage detected