Fix getting attribute in TF FE (#10458)
* if attribute is not present and default value provided it should return default value
This commit is contained in:
parent
b8bbe056b1
commit
ac880f601c
@ -48,7 +48,6 @@ public:
|
||||
|
||||
ov::Any get_attribute_as_any(const std::string& name) const override {
|
||||
auto res = m_decoder.get_attribute(name);
|
||||
FRONT_END_GENERAL_CHECK(!res.empty(), "Attribute with name '", name, "' does not exist");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -165,14 +165,12 @@ const std::string& DecoderProto::get_op_name() const {
|
||||
|
||||
std::vector<::tensorflow::AttrValue> DecoderProto::decode_attribute_helper(const std::string& name) const {
|
||||
auto attr_map = m_node_def->attr();
|
||||
FRONT_END_GENERAL_CHECK(attr_map.contains(name),
|
||||
"An error occurred while parsing the ",
|
||||
name,
|
||||
" attribute of ",
|
||||
this->get_op_type(),
|
||||
"node");
|
||||
auto value = m_node_def->attr().at(name);
|
||||
return {value};
|
||||
if (attr_map.contains(name)) {
|
||||
auto value = m_node_def->attr().at(name);
|
||||
return {value};
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
} // namespace tensorflow
|
||||
} // namespace frontend
|
||||
|
Loading…
Reference in New Issue
Block a user