Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding documentation for the operators: lod_tensor_to_array , array_to_lod_tensor, create_array, increment #6807

Merged
merged 13 commits into from
Dec 21, 2017

Conversation

kavyasrinet
Copy link

This PR has added documentation for the following:

  1. lod_tensor_to_array
  2. array_to_lod_tensor
  3. create_array
  4. increment

Examples:
.. code-block:: python

x = fluid.layers.data(name='x', shape=[10])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for statements in Line457-459, there should be another level of indentation (1 level deeper than the ".. code-block:: python) for proper rendering. Can you check?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it was a formatting issue. Thanks for noticing this!

x = fluid.layers.data(name='x', shape=[10])
table = fluid.layers.lod_rank_table(x, level=0)
array = fluid.layers.lod_tensor_to_array(x, table)
lod_tensor = fluid.layers.array_to_lod_tensor(array, table)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

.. code-block:: python

data = fluid.layers.data(name='data', shape=[32, 32], dtype='float32')
data = fluid.layers.increment(x=data, value=3.0, in_place=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Examples:
.. code-block:: python

data = fluid.layers.create_array(dtype='float32')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@pkuyym pkuyym mentioned this pull request Dec 21, 2017
45 tasks
abhinavarora
abhinavarora previously approved these changes Dec 21, 2017
Copy link
Contributor

@abhinavarora abhinavarora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kavyasrinet kavyasrinet merged commit 61eb085 into PaddlePaddle:develop Dec 21, 2017
@kavyasrinet kavyasrinet deleted the layer_documentation branch January 3, 2018 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants