diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 2feca60430dc04dd839b163c7469a6993570178a..cafb965d406d93229a442ad8e80f262f9cc615b6 100755 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -5448,22 +5448,18 @@ def ctc_greedy_decoder(input, def transpose(x, perm, name=None): """ - :alias_main: paddle.transpose - :alias: paddle.transpose,paddle.tensor.transpose,paddle.tensor.linalg.transpose,paddle.tensor.manipulation.transpose - :old_api: paddle.fluid.layers.transpose - Permute the data dimensions of `input` according to `perm`. The `i`-th dimension of the returned tensor will correspond to the perm[i]-th dimension of `input`. Args: - x (Variable): The input Tensor. It is a N-D Tensor of data types float32, float64, int32. + x (Tensor): The input Tensor. It is a N-D Tensor of data types float32, float64, int32. perm (list|tuple): Permute the input according to the data of perm. name (str): The name of this layer. It is optional. Returns: - Variable: A transposed n-D Tensor, with data type being float32, float64, int32, int64. + Tensor: A transposed n-D Tensor, with data type being float32, float64, int32, int64. For Example: diff --git a/python/paddle/tensor/manipulation.py b/python/paddle/tensor/manipulation.py index a0e5e681c76e9fd1ab404c9c47e97c1002a0b56b..d8b8dab5252919b51acafe1ca390abefe6d9b8b2 100644 --- a/python/paddle/tensor/manipulation.py +++ b/python/paddle/tensor/manipulation.py @@ -1500,6 +1500,7 @@ def strided_slice(x, axes, starts, ends, strides, name=None): strides = [1, 3] Then: result = [ [2], ] + Args: x (Tensor): An N-D ``Tensor``. The data type is ``float32``, ``float64``, ``int32`` or ``int64``. axes (list|tuple): The data type is ``int32`` . Axes that `starts` and `ends` apply to. @@ -1531,7 +1532,7 @@ def strided_slice(x, axes, starts, ends, strides, name=None): # sliced_1 is x[:, 1:3:1, 0:2:1, 2:4:1]. # example 2: # attr starts is a list which contain tensor Tensor. - minus_3 = paddle.fill_constant([1], "int32", -3) + minus_3 = paddle.full(shape=[1], fill_value=-3, dtype='int32') sliced_2 = paddle.strided_slice(x, axes=axes, starts=[minus_3, 0, 2], ends=ends, strides=strides_2) # sliced_2 is x[:, 1:3:1, 0:2:1, 2:4:2]. """