diff --git a/BUILD.md b/BUILD.md index 0407e137ce..c91a85f25d 100644 --- a/BUILD.md +++ b/BUILD.md @@ -106,6 +106,7 @@ The complete list of build options can be found by running `./build.sh (or .\bui **Options** * [OpenMP](#OpenMP) * [OpenBLAS](#OpenBLAS) +* [DebugNodeInputsOutputs](#DebugNodeInputsOutputs) **Architectures** * [x86](#x86) @@ -424,6 +425,30 @@ The DirectML execution provider supports building for both x64 and x86 architect --- +### DebugNodeInputsOutputs +OnnxRuntime supports build options for enabling debugging of intermediate tensor shapes and data. +#### Build Instructions +##### Set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1 +Dump tensor input/output shapes for all nodes to stdout. +``` +# Linux +./build.sh --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1 +# Windows +.\build.bat --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=1 +``` +##### Set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=2 +Dump tensor input/output shapes and output data for all nodes to stdout. +``` +# Linux +./build.sh --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=2 +# Windows +.\build.bat --cmake_extra_defines onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=2 +``` +##### Set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=0 +To disable this functionality after previously enabling, set onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS=0 or delete CMakeCache.txt. + +--- + ## Architectures ### x86 #### Build Intsructions diff --git a/onnxruntime/core/framework/utils.cc b/onnxruntime/core/framework/utils.cc index b7325917c1..a0ee87bbf4 100644 --- a/onnxruntime/core/framework/utils.cc +++ b/onnxruntime/core/framework/utils.cc @@ -646,6 +646,8 @@ void DumpNodeOutputs(OpKernelContext& context, const Node& node, const SessionSt std::cout << " failed to transfer data to cpu.\n"; } } +#else + ORT_UNUSED_PARAMETER(session_state); #endif } }