params[name] = std::to_string(adapter.get());
}
+ void on_adapter(const std::string& name, ngraph::ValueAccessor<std::vector<std::string>>& adapter) override {
+ std::vector<std::string> data = adapter.get();
+ for (auto& str : data) {
+ std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c) {
+ return std::tolower(c);
+ });
+ }
+
+ std::stringstream ss;
+ std::copy(data.begin(), data.end(), std::ostream_iterator<std::string>(ss, ","));
+ params[name] = ss.str();
+ }
+
+ void on_adapter(const std::string& name, ngraph::ValueAccessor<std::vector<float>>& adapter) override {
+ auto data = adapter.get();
+ params[name] = joinVec(data);
+ }
+
void on_adapter(const std::string& name, ::ngraph::ValueAccessor<void>& adapter) override;
private:
} else if (auto a = ::ngraph::as_type<::ngraph::AttributeAdapter<::ngraph::Strides>>(&adapter)) {
auto shape = static_cast<::ngraph::Strides&>(*a);
params[name] = joinVec(shape);
+ } else {
+ THROW_IE_EXCEPTION << "Error converting ngraph to CNN network. "
+ "Attribute adapter can not be found for " << name << " parameter";
}
}
} else if (auto a = ngraph::as_type<ngraph::AttributeAdapter<ngraph::op::TopKMode>>(&adapter)) {
if (!getStrAttribute(node.child("data"), name, val)) return;
static_cast<ngraph::op::TopKMode&>(*a) = ngraph::as_enum<ngraph::op::TopKMode>(val);
+ } else {
+ THROW_IE_EXCEPTION << "Error IR reading. Attribute adapter can not be found for " << name
+ << " parameter";
}
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<double>& adapter) override {
const std::vector<float>& activations_alpha,
const std::vector<float>& activations_beta);
- RNNCellBase() = default;
+ RNNCellBase();
virtual ~RNNCellBase() = default;
virtual bool visit_attributes(AttributeVisitor& visitor);