我要评分
获取效率
正确性
完整性
易理解

Random.InvalidDType Issue

Symptom

The onnxruntime_test_all test program displays the following information indicating that the Random.InvalidDType test case fails:

Key Process and Cause Analysis

The assertion failed because the error message string content is not the same across different environment platforms.

ONNX Runtime expected "Attribute dtype does not specify a valid type in .".

The actual error message provided by the environment is "Attribute dtype does not specify a valid type." (missing "in .").

Conclusion and Solution

  1. Open the /path/to/ONNX_Runtime/onnxruntime/test/providers/cpu/generator/random_test.cc file.
    vi /path/to/ONNX_Runtime/onnxruntime/test/providers/cpu/generator/random_test.cc
  2. Press : to enter command mode then enter the set nu command to display line numbers.
    :set nu
  3. Press i to enter insert mode and change Attribute dtype does not specify a valid type in. to Attribute dtype does not specify a valid type. in lines 181, 197, 213, and 229.
  4. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Recompile and verify. For details, see Compiling the Source Code and Running and Verification.