Hello! I am trying to create a 4d tensor out of a vector of 3d tensors, and am calling stack repeatedly. However, this is causing a segmentation fault, and Im not sure why. The size of the tensors shouldnt be the issue as stack works with torch::randn() of same dimensions.
Could you explain a bit, how you are calling torch::stack repeatedly? Are you calling it on the same tensor (training_data) or on different tensors?
Is the segfault raised in the first call or later?
Thank you for the suggestion. I actually resolved it, and the bug is as you expected due to the type of the image not being correct. I needed to add this statement before I did the resize operation: