问题
I'm testing a library that offloads certain sensitive computations into a secure environment. Tensorflow is one application that I and my team are interested to port to work with this, especially to work with XLA. My team wasn't successful with adding a TF op that does the offload.
For this to work with XLA, I need to insert XLA ops that send and receive data to this library through an API provided by the library. My understanding is that these XLA ops have to be added to the translation of TF ops to XLA ops under tensorflow/compiler/tf2xla/. I'm guessing that the operations listed in ComputationBuilder's definition are the available XLA ops and calling an external function isn't currently one of them.
Is it possible to add such an XLA op which can be lowered into an llvm call instruction ? Or is it possible through other means ?
Please share your thoughts.
Thanks !
PS: Please note that I have a more experience with LLVM than with tensorflow.
来源:https://stackoverflow.com/questions/45074560/tensorflow-xla-passing-tensors-to-external-functions-at-runtime