SessionGetMemoryInfoForOutputs property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtSession> session, Pointer<Pointer<OrtMemoryInfo>> outputs_memory_info, Size num_outputs)>> SessionGetMemoryInfoForOutputs
getter/setter pair

\brief Get the OrtMemoryInfo for each output of the session.

The memory info can be used to determine the device the output tensors are produced on. The user can pre-allocate an OrtValue using this information or use IOBinding to keep the data on the device. ORT will copy the output to CPU otherwise.

The session must be fully initialized before calling this function as the output locations are not known until this has occurred.

\paramin session The OrtSession instance. \paramout outputs_memory_info Pre-allocated array of size num_outputs that will be filled with OrtMemoryInfo* values for each output. The order is the same as returned by SessionGetOutputName. \paramin num_outputs The number of outputs in the session. Must match SessionGetOutputCount.

\snippet{doc} snippets.dox OrtStatus Return Value

\since Version 1.23

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<OrtSession> session,
      ffi.Pointer<ffi.Pointer<OrtMemoryInfo>> outputs_memory_info,
      ffi.Size num_outputs,
    )
  >
>
SessionGetMemoryInfoForOutputs;