-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
documentationimprovements or additions to documentation; typically submitted using templateimprovements or additions to documentation; typically submitted using templatestaleissues that have not been addressed in a while; categorized by a botissues that have not been addressed in a while; categorized by a bot
Description
Describe the documentation issue
The I/O Binding page doesn't seem to show how to get the output tensors when the MemoryInfo output binding is used.
Here is the relevant code snippet.
Ort::Env env;
Ort::Session session(env, model_path, session_options);
Ort::IoBinding io_binding{session};
auto input_tensor = Ort::Value::CreateTensor<float>(memory_info, input_tensor_values.data(), input_tensor_size, input_node_dims.data(), 4);
io_binding.BindInput("input1", input_tensor);
Ort::MemoryInfo output_mem_info{"Cuda", OrtDeviceAllocator, 0,
OrtMemTypeDefault};
// Use this to bind output to a device when the shape is not known in advance. If the shape is known you can use the other overload of this function that takes an Ort::Value as input (IoBinding::BindOutput(const char* name, const Value& value)).
// This internally calls the BindOutputToDevice C API.
io_binding.BindOutput("output1", output_mem_info);
session.Run(run_options, io_binding);
I'm a little confused what to do next to actually get "output1."
Page / URL
https://onnxruntime.ai/docs/performance/tune-performance/iobinding.html
CorbinFoucart
Metadata
Metadata
Assignees
Labels
documentationimprovements or additions to documentation; typically submitted using templateimprovements or additions to documentation; typically submitted using templatestaleissues that have not been addressed in a while; categorized by a botissues that have not been addressed in a while; categorized by a bot