From d8ca66dae29bd688904f5a59a9e2841442637a71 Mon Sep 17 00:00:00 2001 From: gfwm0502 <63550764+gfwm0502@users.noreply.github.com> Date: Fri, 17 Apr 2020 14:13:21 +0800 Subject: [PATCH] Modify documents of executor and randn and fix other errors (#23879) test=develop --- paddle/fluid/operators/controlflow/compare_op.cc | 2 +- python/paddle/fluid/executor.py | 2 +- python/paddle/tensor/random.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/operators/controlflow/compare_op.cc b/paddle/fluid/operators/controlflow/compare_op.cc index 579ff71480..6579a2898b 100644 --- a/paddle/fluid/operators/controlflow/compare_op.cc +++ b/paddle/fluid/operators/controlflow/compare_op.cc @@ -88,7 +88,7 @@ class CompareOp : public framework::OperatorWithKernel { PADDLE_ENFORCE_GE(dim_x.size(), dim_y.size(), platform::errors::InvalidArgument( "The size of dim_y should not be greater than " - "dim_x's, but received dim_y: %d > dim_x: %d", + "dim_x's, but received dim_y: %d > dim_x: %d.\n", dim_y.size(), dim_x.size())); context->SetOutputDim("Out", context->GetInputDim("X")); diff --git a/python/paddle/fluid/executor.py b/python/paddle/fluid/executor.py index ace58854d7..8ceba92dd0 100644 --- a/python/paddle/fluid/executor.py +++ b/python/paddle/fluid/executor.py @@ -516,7 +516,7 @@ class Executor(object): # os.environ['CPU_NUM'] = str(2) # If you don't set place and PaddlePaddle is CPU version - # os.environ['CPU_NUM'] = str(2) + os.environ['CPU_NUM'] = str(2) compiled_prog = compiler.CompiledProgram( train_program).with_data_parallel( diff --git a/python/paddle/tensor/random.py b/python/paddle/tensor/random.py index 6a1cd6cc01..3f73ce186e 100644 --- a/python/paddle/tensor/random.py +++ b/python/paddle/tensor/random.py @@ -31,7 +31,7 @@ from ..fluid.data_feeder import convert_dtype, check_variable_and_dtype, check_t from ..fluid.layers import utils from ..fluid.layers.tensor import fill_constant -__all__ = ['randperm', 'randint'] +__all__ = ['randperm', 'randn', 'randint'] def randint(low, @@ -208,7 +208,7 @@ def randn(shape, shape(list|tuple): Shape of the generated random tensor. out(Variable, optional): Optional output which can be any created Variable that meets the requirements to store the result of operation. If the - out is `None`, a new Variable wiil be returned to store the result. + out is `None`, a new Variable will be returned to store the result. Default is None. dtype(np.dtype|core.VarDesc.VarType|str, optional): Data type of the output tensor, which can be float32, float64. if dtype is `None` , the data @@ -225,7 +225,7 @@ def randn(shape, Default is None. Returns: - Random tensor whose data is drawn from a Gaussian distribution, + Random tensor whose data is drawn from a standard normal distribution, dtype: flaot32 or float64 as specified. Return type: -- GitLab