Please make sure to post the relevant part of your error log the next time which makes it easier to understand what went wrong.
I would start with splitting shape information and data, it seems like you put first the shapes into the data, use it to create tensor shapes and then overwrite the data. I would also make sure that your shape are ints, to avoid any trouble with casting and make the code easier to read.
If you know the output dimensions upfront, you do not need to get the output tensor descs, you can just allocate enough memory and be fine with it.
Then I would add tests to all NNE function to see if they return success.
Finally: Careful with those casts and prints, maybe just comment that code and see if it runs.
Good luck!