Skip to content

Commit e775e9f

Browse files
committed
undo change in lod_tensor.md
1 parent b881f8c commit e775e9f

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

doc/fluid/design/concepts/lod_tensor.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -189,23 +189,3 @@ and the <2,0>-slice of above slice is
189189
10 12
190190
||
191191
```
192-
193-
## Length Representation vs Offset Representation
194-
195-
The offset representation is an implementation-oriented decision and it makes understanding the idea behind LoDTensor difficult.
196-
Hence, we encapsulate this implementation detail in C++ and expose the original length representation in our Python API.
197-
198-
Specifically, user can use the following code to set or get the LoD info of a LoDTensor in Python:
199-
```Python
200-
# lod using length representation
201-
lod = [[1, 3, 2]]
202-
# Create a LoDTensor that has the above lod info.
203-
# This lod will be converted to an offset representation in the C++ implementation under the hood.
204-
tensor = fluid.LoDTensor(lod)
205-
206-
# Set/Change the lod info of LoDTensor
207-
tensor.set_lod([[3, 1, 2]])
208-
# Get the lod info of a LoDTensor (the offset representation stored in C++ will be converted
209-
# back to length representation), new_lod = [[3, 1, 2]]
210-
new_lod = tensor.lod()
211-
```

0 commit comments

Comments
 (0)