fill_¶
- paddle.Tensor. fill_ ( x, value )
- 
         - Notes:
- 
           This API is ONLY available in Dygraph mode 
 This function fill the Tensor with value inplace. - Parameters
- 
           - x (Tensor) – - xis the Tensor we want to filled data inplace
- value (Scale) – - valueis the value to be filled in x
 
- Returns
- 
           Tensor x filled with value inplace 
- Return type
- 
           x(Tensor) 
 Examples import paddle tensor = paddle.to_tensor([0, 1, 2, 3, 4]) tensor.fill_(0) print(tensor.tolist()) #[0, 0, 0, 0, 0] 
