Removed addLayer implementation from ngraph impl (#1400)
This commit is contained in:
parent
54ae67414e
commit
f7d6711137
@ -196,17 +196,6 @@ size_t CNNNetworkNGraphImpl::layerCount() const noexcept {
|
||||
return _ngraph_function->get_ops().size();
|
||||
}
|
||||
|
||||
void CNNNetworkNGraphImpl::addLayer(const CNNLayerPtr& layer) noexcept {
|
||||
try {
|
||||
if (!cnnNetwork) {
|
||||
convertToCNNNetworkImpl();
|
||||
}
|
||||
cnnNetwork->addLayer(layer);
|
||||
} catch (...) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void CNNNetworkNGraphImpl::validate(int version) {
|
||||
if (cnnNetwork)
|
||||
cnnNetwork->validate();
|
||||
|
@ -56,8 +56,6 @@ public:
|
||||
|
||||
void setInputInfo(InputInfo::Ptr data);
|
||||
|
||||
void addLayer(const CNNLayerPtr& layer) noexcept;
|
||||
|
||||
// public version
|
||||
StatusCode setBatchSize(size_t size, ResponseDesc* responseDesc) noexcept override;
|
||||
|
||||
|
@ -492,8 +492,7 @@ bool convertToRNNSeq(CNNLayerPtr cur, const N& net) {
|
||||
|
||||
bool unrollTI(CNNLayerPtr cur, ICNNNetwork& net) {
|
||||
auto inet = dynamic_cast<details::CNNNetworkImpl*>(&net);
|
||||
auto ngraphnet = dynamic_cast<details::CNNNetworkNGraphImpl*>(&net);
|
||||
IE_ASSERT(inet != nullptr || ngraphnet != nullptr);
|
||||
IE_ASSERT(inet != nullptr);
|
||||
|
||||
if (cur->type != "TensorIterator") return true;
|
||||
|
||||
@ -513,8 +512,7 @@ bool unrollTI(CNNLayerPtr cur, ICNNNetwork& net) {
|
||||
auto holder = body_list[i].inputs.back();
|
||||
if (holder->getPrecision() == Precision::UNSPECIFIED) {
|
||||
for (auto kvp : getInputTo(holder)) {
|
||||
if (inet) inet->addLayer(kvp.second);
|
||||
else ngraphnet->addLayer(kvp.second);
|
||||
inet->addLayer(kvp.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1242,14 +1240,12 @@ std::vector<CNNLayerPtr> TopolSort(const details::CNNSubnet& net) {
|
||||
|
||||
void restore_net_consistency(ICNNNetwork& net) {
|
||||
auto inet = dynamic_cast<details::CNNNetworkImpl*>(&net);
|
||||
auto ngraphnet = dynamic_cast<details::CNNNetworkNGraphImpl*>(&net);
|
||||
IE_ASSERT(inet != nullptr || ngraphnet != nullptr);
|
||||
IE_ASSERT(inet != nullptr);
|
||||
// At first all layers should be available via findByName() api.
|
||||
// In other words all layers should be present in internal map<name, layer>
|
||||
IE_SUPPRESS_DEPRECATED_START
|
||||
for (auto& l : TopolSort(net)) {
|
||||
if (inet) inet->addLayer(l);
|
||||
else ngraphnet->addLayer(l);
|
||||
inet->addLayer(l);
|
||||
}
|
||||
IE_SUPPRESS_DEPRECATED_END
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user