This repository has been archived by the owner on May 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 116
Custom Op written in C API compilation Issue #112
Comments
Sure! Here is an example of a custom op written using the C API that can be compiled and executed after being loaded with tf.load_op_library():
|
To compile this custom op, you will need to build it as a shared library. One way to do this is to use the TensorFlow C++ library and build the op as part of a TensorFlow binary. Here is an example of how you might do this using bazel: Create a file named BUILD in the same directory as your custom op code, with the following contents:
|
Run the following command to build the shared library:
This will build a shared library named libmy_add_op.so in the bazel-bin directory. To execute the custom op after loading it with `tf.load_ |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi there!
Is there any example where Custom OP written using C API was compiled successfully and executed after tf_load_library()?
I have referred the entire kernels.h ,ops.h and c_api.h files of the official github tf repo but I am not able to figure it out.
Could someone give the command to execute a C API custom op file along with the code?
Thanks,
Yoga
The text was updated successfully, but these errors were encountered: