Skip to content

Commit

Permalink
Use structured binding for better readability (#3382)
Browse files Browse the repository at this point in the history
  • Loading branch information
wujingyue authored Nov 12, 2024
1 parent 56b6c4d commit d34553f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions csrc/tensor_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,11 @@ std::vector<PolymorphicValue> 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;
Expand Down

0 comments on commit d34553f

Please sign in to comment.