check tensor has storage before refer to tensor data ptr
In the exporter dedupe initializers passes, check the tensor has storage before reference to tensor's data_ptr, otherwise it will result in a crash.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76342
Approved by: https://github.com/BowenBao