Hi Martin, I am a german developer and get the error “Ausnahme ausgelöst bei 0x00007FFEDFEC127E (vcruntime140d.dll) in example-app.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0x000001C42A0C0000.” This Message shows up and at the same time visual studio opens the header file ‘Functions.h’. It stops the execution at line 2558 at
static inline Tensor _th_cat(TensorList tensors, int64_t dim) {
        return detail::infer_type(tensors)._th_cat(tensors, dim);
}

I searched on the internet and it may be some kind of Null pointer exception but I can be wrong (not that much experience). Another confusing thing is that the error even occurs when I comment out the code in the for loop (not the for loop itself). I used the vs debugger to get some information about the problem but there were literally more than 100 values related to the variable tensor and the trace stack shows more than 15 methods that have been called. I can say that the images are transfered to the tensors  correctly. I proofed this with the debugger by giving every line a stoping point.
Believe it or not but sometimes it works and sometimes not (but mostly not).The image values have been converted wrong by me and they cause some weird outputs but this is just a side fact and may not be related to the problem.
Thanks for your answer. Let’s solve this together