Traceback most recent call last File CUsers迪迦pythonProjectfed3shishipy line 180 in module paramdatacopy_selected_particlesipositionRuntimeError The size of tensor a 128 must match the size of tens
This error occurs because the size of the tensor 'param.data' is different from the size of the tensor 'selected_particles[i].position' at a non-singleton dimension.
In other words, the two tensors have different shapes and cannot be copied into each other.
To resolve this error, you need to make sure that the size of the 'param.data' tensor matches the size of the 'selected_particles[i].position' tensor at the dimension where the sizes differ.
You can do this by either resizing the 'param.data' tensor or the 'selected_particles[i].position' tensor to match each other's shape.
Alternatively, you can modify your code to ensure that the tensors being copied into each other have the same shape.
原文地址: https://www.cveoy.top/t/topic/du2q 著作权归作者所有。请勿转载和采集!