Skip to content

Commit

Permalink
Merge branch 'main' into feature/add-frontend-function-paddle-tensor-…
Browse files Browse the repository at this point in the history
…nanmean
  • Loading branch information
AliTarekk authored Aug 27, 2023
2 parents ed8b6a3 + 6ae1289 commit 11f3db7
Show file tree
Hide file tree
Showing 171 changed files with 11,496 additions and 11,121 deletions.
31 changes: 31 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

<!--
This template will help you to have a meaningful PR, please follow it and do not leave it blank.
-->

# PR Description

<!--
If there is no related issue, please add a short description about your PR.
-->

## Related Issue

<!--
Please use this format to link other issues with their numbers: Close #123
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

Close #

## Checklist

- [ ] Did you add a function?
- [ ] Did you add the tests?
- [ ] Did you follow the steps we provided?

### Socials:

<!--
If you have Twitter, please provide it here otherwise just ignore this.
-->
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ repos:
- id: pydocstyle
# Exclude everything in frontends except __init__.py, and func_wrapper.py
exclude: 'ivy/functional/(frontends|backends)/(?!.*/func_wrapper\.py$).*(?!__init__\.py$)'
- repo: https://github.com/unifyai/lint-hook
rev: b9a103a9f7991fec0ed636a2bcd4497691761e78
hooks:
- id: ivy-lint
8 changes: 5 additions & 3 deletions docs/overview/contributing/the_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ a. Find a task to work on which (i) is not marked as completed with a tick (ii)

b. Create a new issue with the title being just the name of the sub-task you would like to work on.

c. Comment on the ToDo list issue with a reference to this issue like so:
c. Comment on the ToDo list issue with a reference to your new issue like so:

:code:`- [ ] #Issue_number`

Your issue will then automatically be added to the ToDo list at some point, and the comment will be deleted.
No need to wait for this to happen before progressing to the next stage. Don’t comment anything else on these ToDo issues, which should be kept clean with comments only as described above.
For example, if your issue number is 12345, then the text of your comment should be :code:`- [ ] #12345`. You could also use just the issue number (:code:`#12345`), or a link to the issue itself (:code:`https://github.com/unifyai/ivy/issues/12345`).

At some point after your comment is made, your issue will automatically be added to the ToDo list and the comment will be deleted.
No need to wait for this to happen before progressing to the next stage. Don’t comment anything else on these ToDo issues, which should be kept clean with comments only as described above.

d. Start working on the task, and create a PR as soon as you have a full or partial solution, and then directly reference the issue in the pull request by adding the following content to the description of the PR:

Expand Down
3 changes: 2 additions & 1 deletion ivy/data_classes/FactorizedTensor/tucker_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import ivy

# global
from scipy.optimize import brentq
from copy import deepcopy
import warnings

Expand Down Expand Up @@ -236,6 +235,8 @@ def tucker_mode_dot(
def validate_tucker_rank(
tensor_shape, rank="same", rounding="round", fixed_modes=None
):
from scipy.optimize import brentq

if rounding == "ceil":
rounding_fun = ivy.ceil
elif rounding == "floor":
Expand Down
83 changes: 39 additions & 44 deletions ivy/data_classes/array/experimental/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ def moveaxis(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning a view
of the input array.
out
optional output array, for writing the result to.
Expand Down Expand Up @@ -129,10 +128,9 @@ def flipud(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
out
optional output array, for writing the result to.
Expand Down Expand Up @@ -233,6 +231,12 @@ def rot90(
----------
self
Input array of two or more dimensions.
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
k
Number of times the array is rotated by 90 degrees.
axes
Expand Down Expand Up @@ -337,10 +341,9 @@ def fliplr(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning a
view of the input array.
out
optional output array, for writing the result to.
Expand Down Expand Up @@ -413,10 +416,9 @@ def flatten(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning a
view of the input array.
start_dim
first dim to flatten. If not set, defaults to 0.
end_dim
Expand Down Expand Up @@ -576,10 +578,9 @@ def vsplit(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
indices_or_sections
If indices_or_sections is an integer n, the array is split into n
equal sections, provided that n must be a divisor of the split axis.
Expand Down Expand Up @@ -629,10 +630,9 @@ def dsplit(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
Returns
-------
Expand Down Expand Up @@ -673,10 +673,9 @@ def atleast_1d(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
Returns
-------
Expand Down Expand Up @@ -745,10 +744,9 @@ def atleast_2d(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
Returns
-------
Expand Down Expand Up @@ -785,10 +783,9 @@ def atleast_3d(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
Returns
-------
Expand Down Expand Up @@ -878,10 +875,9 @@ def hsplit(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
Returns
-------
Expand Down Expand Up @@ -930,10 +926,9 @@ def expand(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
out
optional output array, for writing the result to.
Expand Down
56 changes: 24 additions & 32 deletions ivy/data_classes/array/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,9 @@ def expand_dims(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
out
optional output array, for writing the result to. It must have a shape
that the inputs broadcast to.
Expand Down Expand Up @@ -134,10 +133,9 @@ def flip(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
out
optional output array, for writing the result to.
It must have a shape that the inputs broadcast to.
Expand Down Expand Up @@ -187,10 +185,9 @@ def permute_dims(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
out
optional output array, for writing the result to. It must have a
shape that the inputs broadcast to.
Expand Down Expand Up @@ -248,10 +245,9 @@ def reshape(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
order
Read the elements of the input array using this index order,
and place the elements into the reshaped array using this index order.
Expand Down Expand Up @@ -374,10 +370,9 @@ def squeeze(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
out
optional output array, for writing the result to.
It must have a shape that the inputs broadcast to.
Expand Down Expand Up @@ -598,10 +593,9 @@ def split(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
num_or_size_splits
Number of equal arrays to divide the array into along the given axis if an
integer. The size of each split element if a sequence of integers or
Expand Down Expand Up @@ -658,10 +652,9 @@ def swapaxes(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
out
optional output array, for writing the result to. It must have a
shape that the inputs broadcast to.
Expand Down Expand Up @@ -757,10 +750,9 @@ def unstack(
copy
boolean indicating whether or not to copy the input array.
If True, the function must always copy.
If False, the function must never copy and must
raise a ValueError in case a copy would be necessary.
If None, the function must reuse existing memory buffer if possible
and copy otherwise. Default: ``None``.
If False, the function must never copy.
In case copy is False we avoid copying by returning
a view of the input array.
axis
Axis for which to unpack the array.
keepdims
Expand Down
3 changes: 0 additions & 3 deletions ivy/functional/backends/mxnet/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ def squeeze(
copy: Optional[bool] = None,
out: Optional[Union[(None, mx.ndarray.NDArray)]] = None,
) -> Union[(None, mx.ndarray.NDArray)]:
if copy:
newarr = x.copy()
return mx.nd.squeeze(newarr, axis=axis)
return mx.nd.squeeze(x, axis=axis)


Expand Down
Loading

0 comments on commit 11f3db7

Please sign in to comment.