Reverting tensor_output to heap allocation. Stack will almost certainly fail