From d34553f46e61341f8ac138630273dceb9f6cfbf8 Mon Sep 17 00:00:00 2001 From: Jingyue Wu Date: Tue, 12 Nov 2024 06:57:40 -0800 Subject: [PATCH] Use structured binding for better readability (#3382) --- csrc/tensor_metadata.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csrc/tensor_metadata.cpp b/csrc/tensor_metadata.cpp index 26b5e21338f..0a031c75aae 100644 --- a/csrc/tensor_metadata.cpp +++ b/csrc/tensor_metadata.cpp @@ -382,11 +382,11 @@ std::vector GetMetaData::evaluate( } if (tv->hasAllocation()) { - auto allocation_data = + auto [sizes, strides] = inferAndValidateAllocationSizesAndStrides(input, tv, ee); - metadata->alloc_size_data = std::move(allocation_data.first); + metadata->alloc_size_data = std::move(sizes); metadata->alloc_size = c10::makeArrayRef(metadata->alloc_size_data); - metadata->alloc_stride_data = std::move(allocation_data.second); + metadata->alloc_stride_data = std::move(strides); metadata->alloc_stride = c10::makeArrayRef(metadata->alloc_stride_data); } else { metadata->alloc_size = metadata->logical_size;