Allow reusing existing tensors for outputs of TF_SessionRun() #46711
Labels
comp:apis
Highlevel API related issues
stat:awaiting tensorflower
Status - Awaiting response from tensorflower
type:feature
Feature requests
In the C API,
TF_SessionRun()
allocates new output tensors on every call. This leads to frequent allocation/deallocation and memory copies in some situations. It would be useful to be able to reuse existing tensors for output.The current API takes
TF_Tensor** output_values
and will update that variable to point to newly allocated output tensors. I propose that ifoutput_values
points to existing tensors, those tensors should be used for output instead of allocating new tensors.The text was updated successfully, but these errors were encountered: