Yeah, but if we know the type of memory, the size, and have the pointer, should I be able to just call a release() and it will automatically give up ownership of whatever memory type it was allocated with? It will be up to me as the developer to now do the proper de-allocations elsewhere depending on what the tensor memory type was. A little unsafe but I guess that’s what happens when you go against the grain.
But yeah, I can add some more code to my ManagedMemory to do that and make the tensor live until the duration of the ManagedMemory. Not doing the optional Tensor field method (because the point of ManagedMemory was to have basic dependencies and nothing additional) but some other way.
Thanks for helping me out albanD, it’s really appreciated.