未验证 提交 d8ca66da 编写于 作者: G gfwm0502 提交者: GitHub

Modify documents of executor and randn and fix other errors (#23879)

test=develop
上级 a7563602
......@@ -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"));
......
......@@ -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(
......
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册