From 34f070458aebbb5daea74bd61d52e2f9dc35777b Mon Sep 17 00:00:00 2001 From: Ligoml <39876205+Ligoml@users.noreply.github.com> Date: Mon, 28 Mar 2022 11:33:07 +0800 Subject: [PATCH] update docs dtype(core.VarDesc.VarType)test=document_fix (#40947) * update docs dtype(core.VarDesc.VarType) * fix code style, test=document_fix fix code style, test=document_fix Co-authored-by: Chen Long <1300851984@qq.com> --- python/paddle/fluid/contrib/layers/nn.py | 18 ++---------------- python/paddle/fluid/input.py | 4 ++-- python/paddle/fluid/layers/tensor.py | 4 ++-- python/paddle/tensor/creation.py | 4 ++-- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/python/paddle/fluid/contrib/layers/nn.py b/python/paddle/fluid/contrib/layers/nn.py index ccc83a70296..de7a9d95429 100644 --- a/python/paddle/fluid/contrib/layers/nn.py +++ b/python/paddle/fluid/contrib/layers/nn.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,20 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -# Copyright(c) 2019 PaddlePaddle Authors.All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0(the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http: // www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """ Contrib layers just related to the neural network. """ @@ -1050,7 +1036,7 @@ def sparse_embedding(input, vectors can be loaded with the :attr:`param_attr` parameter. The local word vector needs to be transformed into numpy format, and the shape of local word vector should be consistent with :attr:`size` . - dtype(str|core.VarDesc.VarType): It refers to the data type of output Tensor. It must be float32 or + dtype(str): It refers to the data type of output Tensor. It must be float32 or float64. Default: float32. Returns: diff --git a/python/paddle/fluid/input.py b/python/paddle/fluid/input.py index fc07ab47517..3e46ac52090 100644 --- a/python/paddle/fluid/input.py +++ b/python/paddle/fluid/input.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -214,7 +214,7 @@ def embedding(input, user-defined or pre-trained word vectors can be loaded with the :attr:`param_attr` parameter. The local word vector needs to be transformed into numpy format, and the shape of local word vector should be consistent with :attr:`size` . - dtype(str|core.VarDesc.VarType): It refers to the data type of output Tensor. + dtype(str): It refers to the data type of output Tensor. It must be float32 or float64. Default: float32. Returns: diff --git a/python/paddle/fluid/layers/tensor.py b/python/paddle/fluid/layers/tensor.py index c8d064f26db..f9f65ffb57f 100644 --- a/python/paddle/fluid/layers/tensor.py +++ b/python/paddle/fluid/layers/tensor.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -229,7 +229,7 @@ def cast(x, dtype): Args: x(Tensor): An input N-D Tensor with data type bool, float16, float32, float64, int32, int64, uint8. - dtype(np.dtype|core.VarDesc.VarType|str): Data type of the output: + dtype(np.dtype|str): Data type of the output: bool, float16, float32, float64, int8, int32, int64, uint8. Returns: diff --git a/python/paddle/tensor/creation.py b/python/paddle/tensor/creation.py index 843291e10e6..caed181d453 100644 --- a/python/paddle/tensor/creation.py +++ b/python/paddle/tensor/creation.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -512,7 +512,7 @@ def arange(start=0, end=None, step=1, dtype=None, name=None): it is the istance between two adjacent values, out[i+1] - out[i]. If ``step`` is a Tensor, it is a 1-D Tensor with shape [1], with data type int32, int64, float32, float64. Default is 1. - dtype(str|np.dtype|core.VarDesc.VarType, optional): The data type of the + dtype(str|np.dtype, optional): The data type of the output tensor. Supported data types: int32, int64, float32, float64. If ``dytpe`` is None, the data type is float32. Default is None. name(str, optional): The default value is None. Normally there is no -- GitLab