mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-10 11:00:19 +08:00
add 'GetOutputInfos' and 'GetInputInfos' interface (#232)
add GetOutputInfos GetInputInfos
This commit is contained in:
@@ -247,6 +247,16 @@ TensorInfo OrtBackend::GetInputInfo(int index) {
|
||||
return info;
|
||||
}
|
||||
|
||||
std::vector<TensorInfo> OrtBackend::GetInputInfos() {
|
||||
auto size = inputs_desc_.size();
|
||||
std::vector<TensorInfo> infos;
|
||||
infos.reserve(size);
|
||||
for (auto i = 0; i < size; i++) {
|
||||
infos.emplace_back(GetInputInfo(i));
|
||||
}
|
||||
return infos;
|
||||
}
|
||||
|
||||
TensorInfo OrtBackend::GetOutputInfo(int index) {
|
||||
FDASSERT(index < NumOutputs(),
|
||||
"The index: %d should less than the number of outputs: %d.", index,
|
||||
@@ -259,6 +269,14 @@ TensorInfo OrtBackend::GetOutputInfo(int index) {
|
||||
return info;
|
||||
}
|
||||
|
||||
std::vector<TensorInfo> OrtBackend::GetOutputInfos() {
|
||||
std::vector<TensorInfo> infos;
|
||||
for (auto i = 0; i < outputs_desc_.size(); i++) {
|
||||
infos.emplace_back(GetOutputInfo(i));
|
||||
}
|
||||
return infos;
|
||||
}
|
||||
|
||||
void OrtBackend::InitCustomOperators() {
|
||||
#ifndef NON_64_PLATFORM
|
||||
if (custom_operators_.size() == 0) {
|
||||
|
Reference in New Issue
Block a user