inference_engine_layer_property &property)
{
// Verity tensor info values.
- std::vector<inference_engine_tensor_info>::const_iterator info_iter;
- for (info_iter = property.tensor_infos.begin();
- info_iter != property.tensor_infos.end(); ++info_iter) {
- inference_engine_tensor_info tensor_info = *info_iter;
+ for (auto iter = property.layers.begin(); iter != property.layers.end(); ++iter) {
+ std::string name = iter->first;
+
+ if (name.length() == 0) {
+ LOGE("layer name is invalid.");
+ return INFERENCE_ENGINE_ERROR_INVALID_PARAMETER;
+ }
+
+ inference_engine_tensor_info tensor_info = iter->second;
if (tensor_info.shape.size() == 0 || tensor_info.size == 0) {
LOGE("shape size of tensor info or size of it is 0.");
return INFERENCE_ENGINE_ERROR_INVALID_PARAMETER;
LOGE("tensor data type is invalid.");
return INFERENCE_ENGINE_ERROR_INVALID_PARAMETER;
}
-
- // TODO. we may need to check shape type also.
- }
-
- // Verity layer names.
- std::vector<std::string>::const_iterator name_iter;
- for (name_iter = property.layer_names.begin();
- name_iter != property.layer_names.end(); ++name_iter) {
- std::string name = *name_iter;
-
- if (name.length() == 0) {
- LOGE("layer name is invalid.");
- return INFERENCE_ENGINE_ERROR_INVALID_PARAMETER;
- }
}
return INFERENCE_ENGINE_ERROR_NONE;
// If backend engine doesn't provide input layer property information then just return.
// In this case, user has to provide the information manually.
- if (property.layer_names.size() == 0 &&
- property.tensor_infos.size() == 0) {
+ if (property.layers.size() == 0) {
LOGI("backend doesn't provide input layer property.");
return INFERENCE_ENGINE_ERROR_INVALID_PARAMETER;
}
// If backend engine doesn't provide output layer property information then just return.
// In this case, user has to provide the information manually.
- if (property.layer_names.size() == 0 &&
- property.tensor_infos.size() == 0) {
+ if (property.layers.size() == 0) {
LOGI("backend doesn't provide output layer property.");
return INFERENCE_ENGINE_ERROR_INVALID_PARAMETER;
}
{
CHECK_ENGINE_INSTANCE(mBackendHandle);
- if (property.layer_names.empty() || property.tensor_infos.empty()) {
- LOGE("layer_names or tensor_infos vector of a given property is empty.");
+ if (property.layers.empty()) {
+ LOGE("property is empty.");
return INFERENCE_ENGINE_ERROR_INVALID_PARAMETER;
}
{
CHECK_ENGINE_INSTANCE(mBackendHandle);
- if (property.layer_names.empty()) {
- LOGE("layer_names vector of a given property is empty.");
+ if (property.layers.empty()) {
+ LOGE("property is empty.");
return INFERENCE_ENGINE_ERROR_INVALID_PARAMETER;
}