-// Copyright (C) 2018 Intel Corporation
+// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <map>
#include <string>
#include <blob_factory.hpp>
+#include "graph_transformer.h"
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
#include "cpp_interfaces/base/ie_executable_network_base.hpp"
#include "cpp_interfaces/impl/ie_executable_network_internal.hpp"
StatusCode sts = _loadedNetwork->CreateInferRequest(_createdInferRequest, &resp);
if (sts != OK) THROW_IE_EXCEPTION << resp.msg;
}
+ /**
+ * @brief most plugins successfully consume unreshapable networks - lets do it in base class
+ * WARNING: this functions modifies layers in input network and might affect application, that uses it
+ */
+ virtual ICNNNetwork& RemoveConstLayers(ICNNNetwork &network) {
+ auto* implNetwork = dynamic_cast<details::CNNNetworkImpl*>(&network);
+ if (implNetwork) {
+ // valid for CNNNetworkImpl only, while there's no API in ICNNNetwork to change network
+ ConstTransformer transformator(implNetwork);
+ transformator.fullTrim();
+ }
+ return network;
+ }
/**
* @brief Creates an executable network from an pares network object, users can create as many networks as they need and use
}
_networkOutputs[it.first] = newData;
}
- auto impl = LoadExeNetworkImpl(network, config);
+ auto impl = LoadExeNetworkImpl(RemoveConstLayers(network), config);
impl->setNetworkInputs(_networkInputs);
impl->setNetworkOutputs(_networkOutputs);
// skip setting shared ptr to avoid curricular dependency: ExecutableNetworkBase -> IExecutableNetworkInternal -> InferencePluginInternal