This will add get_float_attr method for accessing attribute float value for tensorflow node
Signed-off-by: SaeHie Park <saehie.park@samsung.com>
return attr.i();
}
+float get_float_attr(const tensorflow::NodeDef &node, const std::string &attr_name)
+{
+ assert(has_attr(node, attr_name));
+ const auto &attr = node.attr().at(attr_name);
+ assert(attr.value_case() == tensorflow::AttrValue::kF);
+ return attr.f();
+}
+
loco::DataType as_loco_datatype(const tensorflow::DataType dtype)
{
switch (dtype)
const std::string &attr_name);
const std::string &get_string_attr(const tensorflow::NodeDef &node, const std::string &attr_name);
int64_t get_int_attr(const tensorflow::NodeDef &node, const std::string &attr_name);
+float get_float_attr(const tensorflow::NodeDef &node, const std::string &attr_name);
loco::DataType as_loco_datatype(const tensorflow::DataType dtype);