xla
16607266 - [LTC] Reuse some methods from LazyTensor (#4294)

Commit
2 years ago
[LTC] Reuse some methods from LazyTensor (#4294) Summary: This patch tweaks XLATensor class to use some identical methods from LazyTensor. Here are a few things worth noting: 1. It renames CurrentXlaData() to CurrentDataHandle() such that we can reuse the latter. 2. It replaces data_ptr() with data() which now returns a const shared_ptr& type. 3. It tweaks the XLATensor::Data class to inherits from LazyTensor::Data. In order to provide accesses to this core data member, here we store two shared_ptrs. One in the LazyTensor class as the LazyTensor::Data type for base class method to access. One in the XLATensor class as the derived XLATensor::Data type such that it's easier to access XLA extra fields within. 4. Methods being removed from XLATensor are: generation(), alias(), GetDevice(), GetUniqueId(), SetTensorData(), and GetNextTensorId(). Test Plan: CI.
Author
Parents
Loading