[ONNX] Fix error comparing tensors on different devices in DeduplicateInitializers
Fixes #75004
Error raised when comparing tensors on different devices.
The solution is to move both tensors to cpu when different
devices are detected.
Improved comparison logic to only compare values when
both tensors have same dtype, shape, and stride.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75273
Approved by: https://github.com/garymm