Quantcast
Channel: AI Beta - Unity Discussions
Viewing all articles
Browse latest Browse all 109

Managing memory when doing operations on tensors

$
0
0

I’m executing a model about once every frame which works well so far, but I want do some processing on the output tensor on-device.
I’m using tensor operations with code that looks like this:

Summary (click for more details)

However, this will leak memory (‘Graphics’ memory in memory profiler increasing steadily). How am I meant to manage memory when using tensor operations? I tried disposing the intermediate tensors, but the documentation doesn’t say I need to and it didn’t fix the issue either way.

I’ve read this other thread, that talks about a different way to do custom calculations, but i don’t see it in the official documentation anywhere. So I’m a bit confused about the best practice here.

Hope somebody can help. Thanks!

12 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 109

Trending Articles