To release the memory, you would have to make sure that all references to the tensor are deleted and call torch.cuda.empty_cache() afterwards.
E.g. del bottoms should only delete the internal bottoms tensor, while the global one should still be alive.
Also, note that torch.cuda.empty_cache() will not avoid out of memory issues, since the cache is reused, not lost.