Skip to content
New issue

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

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

Already on GitHub? # to your account

[Docathon][Add API Legend No.16] Add legend and update doc for atleast_2d #70242

Merged
merged 4 commits into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions python/paddle/tensor/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5295,6 +5295,19 @@ def atleast_2d(*inputs, name=None):
"""
Convert inputs to tensors and return the view with at least 2-dimension. Two or high-dimensional inputs are preserved.

The following diagram illustrates the behavior of atleast_2d on different dimensional inputs for the following cases:

1. A 0-dim tensor input.
2. A 0-dim tensor and a 1-dim tensor input.
3. A 0-dim tensor and a 3-dim tensor input.

.. image:: https://githubraw.cdn.bcebos.com/PaddlePaddle/docs/develop/docs/images/api_legend/atleast_2d.png
:width: 600
:alt: legend of atleast_2d API
:align: center

In each case, the function returns the tensors (or a list of tensors) in views with at least 2 dimensions.

Args:
inputs (Tensor|list(Tensor)): One or more tensors. The data type is ``float16``, ``float32``, ``float64``, ``int16``, ``int32``, ``int64``, ``int8``, ``uint8``, ``complex64``, ``complex128``, ``bfloat16`` or ``bool``.
name (str|None, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.
Expand Down
Loading