From 25c8739362e9a9de14260bdeaa5cb6310cf6b052 Mon Sep 17 00:00:00 2001 From: Kavya Srinet Date: Thu, 11 Jan 2018 17:59:57 -0800 Subject: [PATCH 1/2] Adding the rst file to render IO under Fluid in paddlepaddle.org --- doc/api/v2/fluid.rst | 2 +- doc/api/v2/fluid/io.rst | 10 ++++++++++ python/paddle/v2/fluid/io.py | 10 ++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 doc/api/v2/fluid/io.rst diff --git a/doc/api/v2/fluid.rst b/doc/api/v2/fluid.rst index 43fc19dc49..5f15cad2b5 100644 --- a/doc/api/v2/fluid.rst +++ b/doc/api/v2/fluid.rst @@ -15,4 +15,4 @@ Fluid fluid/param_attr.rst fluid/profiler.rst fluid/regularizer.rst - + fluid/io.rst diff --git a/doc/api/v2/fluid/io.rst b/doc/api/v2/fluid/io.rst new file mode 100644 index 0000000000..861822d36d --- /dev/null +++ b/doc/api/v2/fluid/io.rst @@ -0,0 +1,10 @@ +=========== +IO +=========== + + + +isParameter +----------- +.. autofunction:: paddle.v2.fluid.io.is_parameter + :noindex: diff --git a/python/paddle/v2/fluid/io.py b/python/paddle/v2/fluid/io.py index c63567601a..0d5f68336a 100644 --- a/python/paddle/v2/fluid/io.py +++ b/python/paddle/v2/fluid/io.py @@ -11,6 +11,16 @@ __all__ = [ def is_parameter(var): + """Check whether the variable is a Parameter + + This function checks whether the input variable is a Parameter. + + Args: + var : The input variable. + + Returns: + boolean result whether the variable is a Parameter + """ return isinstance(var, Parameter) From 54791af658d6fe0281ae4fc7ccc0723c21ef282a Mon Sep 17 00:00:00 2001 From: Kavya Srinet Date: Thu, 11 Jan 2018 19:54:00 -0800 Subject: [PATCH 2/2] Addressing review comments --- doc/api/v2/fluid/io.rst | 2 +- python/paddle/v2/fluid/io.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/v2/fluid/io.rst b/doc/api/v2/fluid/io.rst index 861822d36d..67f68c4e9e 100644 --- a/doc/api/v2/fluid/io.rst +++ b/doc/api/v2/fluid/io.rst @@ -4,7 +4,7 @@ IO -isParameter +is_parameter ----------- .. autofunction:: paddle.v2.fluid.io.is_parameter :noindex: diff --git a/python/paddle/v2/fluid/io.py b/python/paddle/v2/fluid/io.py index 0d5f68336a..eef1e283c2 100644 --- a/python/paddle/v2/fluid/io.py +++ b/python/paddle/v2/fluid/io.py @@ -11,7 +11,7 @@ __all__ = [ def is_parameter(var): - """Check whether the variable is a Parameter + """Check whether the variable is a Parameter. This function checks whether the input variable is a Parameter. @@ -19,7 +19,7 @@ def is_parameter(var): var : The input variable. Returns: - boolean result whether the variable is a Parameter + boolean result whether the variable is a Parameter. """ return isinstance(var, Parameter)