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

fixing docs in the experimental API #10569

Merged
merged 3 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
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
25 changes: 17 additions & 8 deletions ivy/container/experimental/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def static_flipud(
Examples
--------
With one :class:`ivy.Container` input:

>>> m = ivy.Container(a=ivy.diag([1, 2, 3]), b=ivy.arange(4))
>>> ivy.Container.static_flipud(m)
{
Expand Down Expand Up @@ -287,6 +288,7 @@ def flipud(
Examples
--------
With one :class:`ivy.Container` input:

>>> m = ivy.Container(a=ivy.diag([1, 2, 3]), b=ivy.arange(4))
>>> m.flipud()
{
Expand Down Expand Up @@ -366,9 +368,11 @@ def static_vstack(
Examples
--------
With one :class:`ivy.Container` input:

>>> c = ivy.Container(a=[ivy.array([1,2,3]), ivy.array([0,0,0])],
b=ivy.arange(3))
>>> ivy.Container.static_vstack(c)
>>> y = ivy.Container.static_vstack(c)
>>> print(y)
{
a: ivy.array([[1, 2, 3],
[0, 0, 0]]),
Expand Down Expand Up @@ -410,7 +414,8 @@ def hstack(
--------
>>> x = ivy.Container(a=ivy.array([[0, 1], [2,3]]), b=ivy.array([[4, 5]]))
>>> y = ivy.Container(a=ivy.array([[3, 2], [1,0]]), b=ivy.array([[1, 0]]))
>>> x.hstack([y])
>>> z = x.hstack([y])
>>> print(z)
{
a: ivy.array([[0, 1, 3, 2],
[2, 3, 1, 0]]),
Expand Down Expand Up @@ -517,7 +522,8 @@ def static_rot90(
>>> m = ivy.Container(a=ivy.array([[1,2], [3,4]]),\
b=ivy.array([[1,2,3,4],\
[7,8,9,10]]))
>>> ivy.Container.static_rot90(m)
>>> n = ivy.Container.static_rot90(m)
>>> print(n)
{
a: ivy.array([[2, 4],
[1, 3]]),
Expand Down Expand Up @@ -587,9 +593,9 @@ def rot90(
Examples
--------
>>> m = ivy.Container(a=ivy.array([[1,2], [3,4]]),\
b=ivy.array([[1,2,3,4],\
[7,8,9,10]]))
>>> m.rot90()
... b=ivy.array([[1,2,3,4],[7,8,9,10]]))
>>> n = m.rot90()
>>> print(n)
{
a: ivy.array([[2, 4],
[1, 3]]),
Expand Down Expand Up @@ -810,7 +816,7 @@ def static_fliplr(
--------
With one :class:`ivy.Container` input:
>>> m = ivy.Container(a=ivy.diag([1, 2, 3]),\
b=ivy.array([[1, 2, 3],[4, 5, 6]]))
... b=ivy.array([[1, 2, 3],[4, 5, 6]]))
>>> ivy.Container.static_fliplr(m)
{
a: ivy.array([[0, 0, 1],
Expand Down Expand Up @@ -856,8 +862,9 @@ def fliplr(
Examples
--------
With one :class:`ivy.Container` input:

>>> m = ivy.Container(a=ivy.diag([1, 2, 3]),\
b=ivy.array([[1, 2, 3],[4, 5, 6]]))
... b=ivy.array([[1, 2, 3],[4, 5, 6]]))
>>> m.fliplr()
{
a: ivy.array([[0, 0, 1],
Expand Down Expand Up @@ -901,6 +908,7 @@ def static_i0(
Examples
--------
With one :class:`ivy.Container` input:

>>> x = ivy.Container(a=ivy.array([1, 2, 3]), b=ivy.array(4))
>>> ivy.Container.static_i0(x)
{
Expand Down Expand Up @@ -944,6 +952,7 @@ def i0(
Examples
--------
With one :class:`ivy.Container` input:

>>> x = ivy.Container(a=ivy.array([1, 2, 3]), b=ivy.array(4))
>>> x.i0()
{
Expand Down
12 changes: 1 addition & 11 deletions ivy/functional/ivy/experimental/linear_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@ def diagflat(
ret
The 2-D output array.


This function conforms to the `Array API Standard
<https://data-apis.org/array-api/latest/>`_. This docstring is an extension of the
`docstring <https://data-apis.org/array-api/latest/extensions/generated/signatures.linalg.diagonal.html>`_ # noqa
in the standard.

Both the description and the type hints above assumes an array input for simplicity,
but this function is *nestable*, and therefore also accepts :class:`ivy.Container`
instances in place of any of the arguments.

Functional Examples
------------------

Expand Down Expand Up @@ -185,7 +175,7 @@ def eig(
/,
) -> Tuple[ivy.Array]:
"""Computes eigenvalies and eigenvectors of x. Returns a tuple with two elements:
first is the set of eigenvalues, second is the set of eigenvectors.
first is the set of eigenvalues, second is the set of eigenvectors.

Parameters
----------
Expand Down
6 changes: 3 additions & 3 deletions ivy/functional/ivy/experimental/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def flatten(
out: Optional[ivy.Array] = None,
) -> ivy.Array:
"""Flattens input by reshaping it into a one-dimensional tensor.
If start_dim or end_dim are passed, only dimensions starting
with start_dim and ending with end_dim are flattened.
The order of elements in input is unchanged.
If start_dim or end_dim are passed, only dimensions starting
with start_dim and ending with end_dim are flattened.
The order of elements in input is unchanged.

Parameters
----------
Expand Down