openvino
openvino copied to clipboard
[Good First Issue][TFL FE]: Support GELU operation for TensorFlow Lite
Context
OpenVINO component responsible for support of TensorFlow Lite models is called as TensorFlow Lite Frontend (TFL FE). TFL FE converts a model represented in TensorFlow Lite opset to a model in OpenVINO opset.
TensorFlow Lite opset is specified via
What needs to be done?
For GELU operation support, you need to implement:
- common gelu loader directory link and register it in common operation table.
OutputVector translate_gelu_op(const NodeContext& node) {
default_op_checks(node, 1, {"GELU"});
auto x = node.get_input(0);
// update these lines for best translation
auto approximate = node.get_attribute<element::boolean>("approximate");
auto res = make_shared<v7::Gelu>(x, ...);
//
set_node_name(node.get_name(), res);
return res->outputs();
}
- TFL specific loader directory link
OutputVector gelu(const ov::frontend::tensorflow_lite::NodeContext& node) {
const auto& decoder = get_decoder(node);
std::map<std::string, ov::Any> attrs{
{"approximate", decoder->get_attribute(&GeluOptions::approximate)},
};
return attribute_helper(node, attrs, ov::frontend::tensorflow::op::translate_gelu_op);
}
-
register loader into the dictionary of Loaders: header, source.
- header:
TFL_OP_CONVERTER(gelu); - source:
{"GELU", DEQUANTIZE_INPUTS(gelu)},
- header:
-
implement layer test for your solution: link
One loader is responsible for conversion (or decomposition) of one type of TensorFlow Lite operation.
Useful links for TFL GELU support:
- TFL Reference implementation
- TFL Attributes
- OpenVINO operation to use link
- OpenVINO Gelu specification link
Resources
- Contribution guide - start here!
- Intel DevHub Discord channel - engage in discussions, ask questions and talk to OpenVINO developers
Contact points
@jane-intel
.take
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
.take
Thanks for being interested in this issue. It looks like this ticket is already assigned to a contributor. Please communicate with the assigned contributor to confirm the status of the issue.
Hi @kartik912,
Please share your update on this task.
Best regards, Roman
I'm reopening the issue due to current assignee's inactivity.
Hi @p-wysocki ! Would love to contribute to this issue. Can you assign it to me?
so it's yours, have fun :)