Can we integrate TensorRT5.0+ and our customirized deep neural network based-on Caffe ?

TensorRT as inter-media inferece engine, input and output Still executed by our own program.
Just like below:

Input – our own program – TensorRT – our own program – output

The process provided by Nvidia as below:

Our own program – Input – TensorRT --output