tensorflow / text

Making text a first-class citizen in TensorFlow.
https://www.tensorflow.org/beta/tutorials/tensorflow_text/intro
Apache License 2.0
1.23k stars 345 forks source link

build c++ api #580

Open fwz-fpga opened 3 years ago

fwz-fpga commented 3 years ago

I have build Tensorflow from source and get libtensorflow_cc.so libtensorflow_framework.so. How can I build tf-text to get a c++ so. I can't find documents about this.

broken commented 3 years ago

In the readme we have build from source steps. This creates a pip package, and you can unzip it and find the c++ so files in it or in the build directory (bazel-bin/oss_scripts/pip_package/build_pip_package.runfiles/org_tensorflow_text/tensorflow_text).

There is a separate shared object file for each c++ op.

fwz-fpga commented 3 years ago

Thanks! Can these so files(operations) loaded by tensorflow api? Bert model use these tf-text operations.

broken commented 3 years ago

By importing tensorflow_text, these ops are automatically registered by TF and can be used by the BERT model. If you want to include the libs without tensorflow_text, I'm not sure how you would do it as you would need to somehow register them with tf still.