fix meta() calls for non-storage tensors (i.e. xla) (#56306)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56306
It turns out that TensorIteratorBase `meta()` calls don't work with XLA tensors, since the logic that builds up the `TensorIteratorBase` object also tries to grab/store the underlying tensors' data pointers. This doesn't work for XLA because they don't have storage.
I think it's fine to just skip this bit of logic for tensors that don't have storage- since the data_ptr information isn't important to the meta call, and TensorIterator isn't actually used in the implementation for non-native kernels, i.e. XLA.
Test Plan: Imported from OSS
Reviewed By: bhosmer
Differential Revision: D27883949
Pulled By: bdhirsh
fbshipit-source-id: 7db4358b94b23c504a383f9673dc509c4020a708