linspace¶
- paddle.fluid.layers.tensor. linspace ( start, stop, num, dtype=None, name=None ) [source]
- 
         This OP return fixed number of evenly spaced values within a given interval. - Parameters
- 
           - start (int|float|Tensor) – The input - startis start variable of range. It is a scalar, or a Tensor of shape [1] with input data type int32, int64, float32 or float64.
- stop (int|float|Tensor) – The input - stopis start variable of range. It is a scalar, or a Tensor of shape [1] with input data type int32, int64, float32 or float64.
- num (int|Tensor) – The input - numis given num of the sequence. It is an int scalar, or a Tensor of shape [1] with data type int32.
- dtype (np.dtype|str, optional) – The data type of output tensor, it could be int32, int64, float32 and float64. Default: if None, the data type is float32. 
- name (str, optional) – Normally there is no need for user to set this property. For more information, please refer to Name.Default: None. 
 
- Returns
- 
           the output data type will be float32, float64. The 1-D tensor with fixed number of evenly spaced values, the data shape of this tensor is \([num]\) . If the numis set 1, the output tensor just has the value with inputstart.
- Return type
- 
           Tensor 
 Examples import paddle data = paddle.linspace(0, 10, 5, 'float32') # [0.0, 2.5, 5.0, 7.5, 10.0] data = paddle.linspace(0, 10, 1, 'float32') # [0.0] 
