I find the ERROR in test02,  the problem appears when I created the labels.  I send
targets.to(torch::kFloat32)

but it should be:
targets.to(torch::kInt64)

after that change everything works great, for test02