Thank you! I made h a list and then used it to populate the output tensor. When I did this I no longer required the use of .clone() and that greatly reduced the amount of memory required.
I am having some trouble making it work on my gpu but I will figure that out tomorrow.
thanks again