Skip to content

Instantly share code, notes, and snippets.

View sathyarr's full-sized avatar
🏄‍♂️

Sathya R sathyarr

🏄‍♂️
View GitHub Profile
@sathyarr
sathyarr / gather_tree_py_custom.cc
Last active July 30, 2021 12:50
Custom operation to replace py_func in google/seq2seq(beam_search.py#L90). Using this Custom operation helps to successfully export the model for Tensorflow Serving.
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/shape_inference.h"
#include "tensorflow/core/framework/op_kernel.h"
using namespace tensorflow;
REGISTER_OP("GatherTreePyCustom")
.Input("values: int32")
.Input("parents: int32")
.Output("res: int32");