File tree Expand file tree Collapse file tree 1 file changed +0
-20
lines changed
doc/fluid/design/concepts Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change @@ -189,23 +189,3 @@ and the <2,0>-slice of above slice is
18918910 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- ```
You can’t perform that action at this time.
0 commit comments