File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,11 @@ PYBIND11_PLUGIN(core) {
159
159
new (&instance) LoDTensor (new_offset_lod);
160
160
})
161
161
.def (" __init__" , [](LoDTensor &instance) { new (&instance) LoDTensor (); })
162
+ // We implement offset based LOD in C++ while we use length based with
163
+ // Python API. So we changed set_lod to set_recursive_sequence_lengths to
164
+ // avoid misuse.
165
+ // The discussion is here:
166
+ // https://github.com/PaddlePaddle/Paddle/issues/10855
162
167
.def (" set_lod" ,
163
168
[](LoDTensor &self, const std::vector<std::vector<size_t >> &lod) {
164
169
// the input lod is offset-based level-of-detail info
@@ -199,6 +204,7 @@ PYBIND11_PLUGIN(core) {
199
204
std::copy (lod.begin (), lod.end (), std::back_inserter (new_lod));
200
205
return new_lod;
201
206
})
207
+ // Set above comments of set_lod.
202
208
.def (" recursive_sequence_lengths" ,
203
209
[](LoDTensor &self) -> std::vector<std::vector<size_t >> {
204
210
// output the length-based lod info
You can’t perform that action at this time.
0 commit comments