Returns true iff this tensor is aligned.
| 288 | |
| 289 | /// Returns true iff this tensor is aligned. |
| 290 | bool IsAligned() const { |
| 291 | #if EIGEN_MAX_ALIGN_BYTES == 0 |
| 292 | return true; |
| 293 | #else |
| 294 | void* ptr = base<void>(); |
| 295 | return dtype() == DT_STRING || |
| 296 | (reinterpret_cast<intptr_t>(ptr) % EIGEN_MAX_ALIGN_BYTES == 0); |
| 297 | #endif |
| 298 | } |
| 299 | |
| 300 | /// Assign operator. This tensor shares other's underlying storage. |
| 301 | Tensor& operator=(const Tensor& other) { |