Tensor memory management #334
-
Hi folks, I want to use the Yolo model in pretty much real-time scenarios, thus wishing to avoid allocating memory in the heap on every frame. From the documentation, I learned:
With that in mind, I would assume the safest for me would be just using
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
When using The only exception to this is
The correct way would be to use Note that:
With this in mind:
For best performance I would also recommend two things:
Footnotes
|
Beta Was this translation helpful? Give feedback.
When using
Session::run
with a session allocated on a non-CPU device, the data in every input is always copied to the device before inference. Updatingtensor
will update the data on the GPU at the next pointSession::run
is called.The only exception to this is
IoBinding
- a bound input must be manually synchronized in order for the data to be copied.