-// Copyright (C) 2018 Intel Corporation
+// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
Lrn,
Pooling,
FullyConnected,
+ FullyConnected_Activation,
SoftMax,
Split,
Concatenation,
Copy,
MemoryOutput,
MemoryInput,
- LSTMCell,
- RNN
+ RNNCell,
+ RNNSeq,
+ Quantize,
+ BinaryConvolution
};
static Type TypeFromName(const std::string type) {
{ "Logistic", Activation },
{ "TanH", Activation },
{ "ReLU6", Activation },
+ { "Exp", Activation },
+ { "Not", Activation },
{ "Activation", Activation },
{ "ScaleShift", Depthwise },
{ "PReLU", Depthwise },
{ "Flatten", Flatten },
{ "Permute", Permute },
{ "Copy", Copy },
- { "LSTMCell", LSTMCell },
- { "RNN", RNN },
+ { "LSTMCell", RNNCell },
+ { "GRUCell", RNNCell },
+ { "RNNCell", RNNCell },
+ { "LSTMSequence", RNNSeq },
+ { "GRUSequence", RNNSeq },
+ { "RNNSequence", RNNSeq },
+ { "Quantize", Quantize },
+ { "BinaryConvolution", BinaryConvolution },
{ "MemoryInput", MemoryInput}, // for construction from name ctor, arbitrary name is used
{ "Memory", MemoryOutput }, // for construction from layer ctor
};
~MKLDNNNode() override = default;
- void addEdge(const MKLDNNEdgeWeakPtr& edge, size_t pIndex, size_t cIndex, bool insertChildIndex = false);
+ void addEdge(const MKLDNNEdgeWeakPtr& edge);
void removeEdge(const MKLDNNEdgeWeakPtr& edge);
virtual void cleanup();
const MKLDNNEdgePtr getParentEdgeAt(size_t idx) const;
virtual const MKLDNNEdgePtr getChildEdgeAt(size_t idx) const;
+ const std::vector<MKLDNNEdgePtr> getParentEdgesAtPort(size_t idx) const;
+ const std::vector<MKLDNNEdgePtr> getChildEdgesAtPort(size_t idx) const;
bool isDropped() {
return (isEdgesEmpty(childEdges) && isEdgesEmpty(parentEdges));
mergedWith.push_back(merge);
}
+ void addOriginalLayer(const InferenceEngine::CNNLayerPtr &layer);
+
const std::vector <MKLDNNNodePtr> &getMergeWith() {
return mergedWith;
}
return name;
}
+ const std::string getOriginalLayers() const {
+ return originalLayers;
+ }
+
Type getType() const {
return type;
}
THROW_IE_EXCEPTION << "Primitive descriptor was not found for node " << getName() << ".";
}
- static void invertVectorCopyUtoI(const InferenceEngine::PropertyVector<unsigned int>& src, std::vector<int>& dst) {
+ static void invertVectorCopyUtoI(const InferenceEngine::PropertyVector<unsigned int>& src, std::vector<ptrdiff_t>& dst) {
dst.clear();
for (int i = 1; i <= src.size(); i++) {
- dst.push_back(static_cast<int>(src[src.size() - i]));
+ dst.push_back(static_cast<ptrdiff_t>(src[src.size() - i]));
}
}
+ std::vector<MKLDNNDims> inDims;
+
+
protected:
// TODO: It is necessary only in order to avoid modifications of cnnLayers and original topology
std::vector<MKLDNNDims> outDims;
- std::vector<MKLDNNDims> inDims;
void setType(Type type) {
this->type = type;
}
virtual MKLDNNMemoryDesc getSrcMemDesc(mkldnn::primitive_desc_iterator &primitive_desc_it, size_t idx);
virtual MKLDNNMemoryDesc getDstMemDesc(mkldnn::primitive_desc_iterator &primitive_desc_it, size_t idx);
+ virtual std::shared_ptr<mkldnn::primitive_attr> initPrimitiveAttr() const { return nullptr; }
+
typedef std::function<MKLDNNMemoryDesc (mkldnn::primitive_desc_iterator &primitive_desc_it, size_t idx)>
GetPrimitiveMemoryFormatFunc;
std::vector<GetPrimitiveMemoryFormatFunc> internalBlobDesc;
std::vector <MKLDNNNodePtr> mergedWith;
std::vector <impl_desc_type> implPriorities;
+ std::string originalLayers; // contains names of the original layers separated by comma
+
MKLDNNNode(const InferenceEngine::CNNLayerPtr& layer, const mkldnn::engine& eng);
int selectedPrimitiveDescriptorIndex = -1;