Skip to content

Commit

Permalink
Adjust linkage, fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
yuslepukhin committed Sep 13, 2024
1 parent 30f3e63 commit 583f976
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)
#onnxruntime_common is kind of ok because it is thin, tiny and totally stateless.
set(onnxruntime_perf_test_libs
onnx_test_runner_common onnxruntime_test_utils onnxruntime_common
onnxruntime onnxruntime_lora onnxruntime_flatbuffers onnx_test_data_proto
onnxruntime onnxruntime_flatbuffers onnx_test_data_proto
${onnxruntime_EXTERNAL_LIBRARIES}
${GETOPT_LIB_WIDE} ${SYS_PATH_LIB} ${CMAKE_DL_LIBS})
if(NOT WIN32)
Expand All @@ -1255,7 +1255,7 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)
list(APPEND onnxruntime_perf_test_libs ${android_shared_libs})
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "AIX")
list(APPEND onnxruntime_perf_test_libs onnxruntime_graph onnxruntime_session onnxruntime_providers onnxruntime_lora onnxruntime_framework onnxruntime_util onnxruntime_mlas onnxruntime_optimizer onnxruntime_flatbuffers iconv re2 gtest absl_failure_signal_handler absl_examine_stack absl_flags_parse absl_flags_usage absl_flags_usage_internal)
list(APPEND onnxruntime_perf_test_libs onnxruntime_graph onnxruntime_session onnxruntime_providers onnxruntime_framework onnxruntime_util onnxruntime_mlas onnxruntime_optimizer onnxruntime_flatbuffers iconv re2 gtest absl_failure_signal_handler absl_examine_stack absl_flags_parse absl_flags_usage absl_flags_usage_internal)
endif()
target_link_libraries(onnxruntime_perf_test PRIVATE ${onnxruntime_perf_test_libs} Threads::Threads)
if(WIN32)
Expand Down Expand Up @@ -1339,7 +1339,7 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)
endif()

if (${CMAKE_SYSTEM_NAME} MATCHES "AIX")
list(APPEND onnxruntime_shared_lib_test_LIBS onnxruntime_graph onnxruntime_session onnxruntime_providers onnxruntime_framework onnxruntime_util onnxruntime_mlas onnxruntime_optimizer onnxruntime_lora onnxruntime_flatbuffers iconv re2)
list(APPEND onnxruntime_shared_lib_test_LIBS onnxruntime_graph onnxruntime_session onnxruntime_providers onnxruntime_framework onnxruntime_util onnxruntime_mlas onnxruntime_optimizer onnxruntime_flatbuffers iconv re2)
endif()

AddTest(DYN
Expand Down
3 changes: 1 addition & 2 deletions onnxruntime/python/onnxruntime_pybind_ortvalue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ void addOrtValueMethods(pybind11::module& m) {

auto cpu_allocator = GetAllocator();
auto ort_value = std::make_unique<OrtValue>();
const auto shape_span = gsl::make_span(data.shape(), data.ndim());
Tensor::InitOrtValue(element_type, TensorShape{shape_span},
Tensor::InitOrtValue(element_type, GetShape(data),
const_cast<void*>(data.data()), cpu_allocator->Info(), *ort_value);
return ort_value;
})
Expand Down

0 comments on commit 583f976

Please sign in to comment.