tolist¶
- paddle. tolist ( x ) [source]
- 
         Note This API is ONLY available in Dygraph mode. This function translate the paddle.Tensor to python list. - Parameters
- 
           x (Tensor) – xis the Tensor we want to translate to list.
- Returns
- 
           A list that contain the same value of current Tensor. 
- Return type
- 
           list 
 Examples import paddle t = paddle.to_tensor([0,1,2,3,4]) expectlist = t.tolist() print(expectlist) #[0, 1, 2, 3, 4] expectlist = paddle.tolist(t) print(expectlist) #[0, 1, 2, 3, 4] 
