From 59403c3bc3ac3b4a01af925d7a1aba2db60467a7 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Wed, 20 Dec 2017 15:57:58 +0800 Subject: [PATCH] Add comment of GetSubLoDAndAbsoluteOffset (#6771) --- paddle/framework/lod_tensor.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/paddle/framework/lod_tensor.h b/paddle/framework/lod_tensor.h index 9411c96aea4..0923c52a0ad 100644 --- a/paddle/framework/lod_tensor.h +++ b/paddle/framework/lod_tensor.h @@ -184,6 +184,18 @@ LoDTensor LodExpand(const LoDTensor& source, const LoD& lod, size_t level, return tensor; } +// Get the absolute offset of a lod[start_level][start_idx:end_idx] and +// relative length of details for every levels(i.e., [start_level: ]). +// +// For example, +// lod = [[0, 3, 4, 8], [0, 9, 10, 11, 13, 17, 19, 22, 24]] +// start_level = 0 +// start_idx = 1 +// end_idx = 3 +// +// Returns: +// LoD = [[1, 4], [2, 4, 2, 3, 2]] +// pair = {11, 24} std::pair> GetSubLoDAndAbsoluteOffset( const LoD& lod, size_t start_idx, size_t end_idx, size_t start_level); -- GitLab