I’ve tried the debug with gdb and, when I run the script I got the PC blocked again. This doesn’t allow me to do the backtrace.
So, I imagine that the issue on this error is in the loop where I do the cast, in the following lines:
for i in range(X_train.size):
    aux.flat[i] = sp.posit8(X_train.flat[i])

I’ve searched the size and structure of trai dataset, and I figure out that is a 5 dimension tensor with this structure: [1875][32][1][32][32] which makes 61,440,000 elements to cast. So, can the reason of the error be the huge size of the dataset?
Moreover, I have tried another way of making the cast to Posit8 with this definition:
def TensorToP8(X_array, Y_array, narray):
    c1=0
    c2=0
    c3=0
    c4=0
    c5=0
    k=0

    for i1,y in narray:
        for i2 in i1:
            for i3 in i2:
                for i4 in i3:
                    for i5 in i4:
                        X_array[c1][c2][c3][c4][c5] = sp.posit8(np.double(i5))
                        c5+=1
                    c4+=1
                    c5=0
                c3+=1
                c4=0
            c2+=1
            c3=0
        for y2 in y:
            Y_array[c1][k] = y2.numpy()
            k+=1
        c1+=1
        c2=0
        k=0
    return X_array,Y_array       

I used it with this call:
X_train= np.ndarray([1875,32,1,32,32])
Y_train = np.ndarray([1875,32])
X_validate = np.ndarray([313,32,1,32,32])
Y_validate = np.ndarray([313,32])

X_train, Y_train = TensorToP8(X_train,Y_train,train_loader)

X_validate, Y_validate = TensorToP8(X_validate,Y_validate, valid_loader)

It works, but doesn’t change the datatype. So, I tried to initially change the datatype of the ndarrays with this:
X_train= np.ndarray([1875,32,1,32,32],  dtype=sp.posit8)
X_validate = np.ndarray([313,32,1,32,32],  dtype=sp.posit8)

And, with this change, I get again the PC blocked. So, can it be due to the datatype format of softposit and the huge amount of data the reason that the kernel is not capable of making the cast?