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

feat: created func for bilinear #28193

Closed
wants to merge 73 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
7c564ec
created function for bilinear
Sanjay8602 Jan 23, 2024
2573c52
🤖 Lint code
ivy-branch Jan 23, 2024
93d022f
rotate function created
Sanjay8602 Jan 26, 2024
f406f1d
Merge branch 'master' of https://github.com/Sanjay8602/ivy
Sanjay8602 Jan 26, 2024
af1eb79
🤖 Lint code
ivy-branch Jan 26, 2024
0d7b7ee
Delete ivy_tests/test_ivy/test_frontends/test_paddle/test_vision/test…
Sanjay8602 Jan 26, 2024
9e85ca0
Delete ivy/functional/frontends/paddle/vision/transforms.py
Sanjay8602 Jan 26, 2024
f873cbd
Merge branch 'unifyai:main' into master
Sanjay8602 Jan 26, 2024
6b3c7ce
bilinear function created
Sanjay8602 Jan 26, 2024
0e5e330
bilinear function is defined
Sanjay8602 Jan 26, 2024
8f796bb
Merge branch 'master' of https://github.com/Sanjay8602/ivy
Sanjay8602 Jan 26, 2024
2da3824
🤖 Lint code
ivy-branch Jan 26, 2024
8e30148
Update test_common.py
Sanjay8602 Jan 26, 2024
1e7ff04
🤖 Lint code
ivy-branch Jan 26, 2024
1c98200
Update common.py
Sanjay8602 Jan 26, 2024
4038a1f
🤖 Lint code
ivy-branch Jan 26, 2024
60207d1
Merge branch 'unifyai:main' into master
Sanjay8602 Feb 1, 2024
fc04d99
Merge branch 'unifyai:main' into master
Sanjay8602 Feb 2, 2024
e03a2c5
Update test_common.py
Sanjay8602 Feb 2, 2024
7f9c9bf
🤖 Lint code
ivy-branch Feb 2, 2024
d73e518
mistake reseted
Sanjay8602 Feb 5, 2024
b05912b
🤖 Lint code
ivy-branch Feb 5, 2024
58b2916
mistake reseted.
Sanjay8602 Feb 5, 2024
88b0217
mistake reseted.
Sanjay8602 Feb 5, 2024
cea6aa6
🤖 Lint code
ivy-branch Feb 5, 2024
d154041
mistake reseted.
Sanjay8602 Feb 5, 2024
c8ded42
.
Sanjay8602 Feb 5, 2024
dc8aae0
🤖 Lint code
ivy-branch Feb 5, 2024
4f88e3f
bilinear func crearted
Sanjay8602 Feb 5, 2024
9d2bf3f
bilinerar func created
Sanjay8602 Feb 5, 2024
000dd2d
🤖 Lint code
ivy-branch Feb 5, 2024
a7934e3
Merge remote-tracking branch 'upstream/main' into pr/28193
NripeshN Feb 6, 2024
d452c7b
Update test_common.py
Sanjay8602 Feb 11, 2024
1e8a792
Update common.py
Sanjay8602 Feb 17, 2024
01f3ab0
🤖 Lint code
ivy-branch Feb 17, 2024
eeb2690
Update test_common.py
Sanjay8602 Feb 17, 2024
c71591c
Update test_common.py
Sanjay8602 Feb 17, 2024
54bfe56
🤖 Lint code
ivy-branch Feb 17, 2024
1872c4f
Update common.py
Sanjay8602 Feb 17, 2024
098e624
🤖 Lint code
ivy-branch Feb 17, 2024
3c49f44
Update common.py
Sanjay8602 Feb 17, 2024
ce94bdb
🤖 Lint code
ivy-branch Feb 17, 2024
691cad0
Update test_common.py
Sanjay8602 Feb 20, 2024
e8d03b4
🤖 Lint code
ivy-branch Feb 20, 2024
87a82ae
Update test_common.py
Sanjay8602 Feb 21, 2024
1ea9a1f
Update test_common.py
Sanjay8602 Feb 23, 2024
567b18b
Update test_common.py
Sanjay8602 Feb 23, 2024
81a31f9
Update test_common.py
Sanjay8602 Feb 29, 2024
9802f88
🤖 Lint code
ivy-branch Feb 29, 2024
2920db2
Update test_common.py
Sanjay8602 Feb 29, 2024
95d736c
🤖 Lint code
ivy-branch Feb 29, 2024
b895315
Update test_common.py
Sanjay8602 Mar 2, 2024
c0d48c4
Update test_common.py
Sanjay8602 Mar 2, 2024
bb1fa76
🤖 Lint code
ivy-branch Mar 2, 2024
a667f57
Update test_common.py
Sanjay8602 Mar 2, 2024
6926274
Update test_common.py
Sanjay8602 Mar 2, 2024
b111969
Update common.py
Sanjay8602 Mar 4, 2024
14da719
Update test_common.py
Sanjay8602 Mar 4, 2024
081c814
Update test_common.py
Sanjay8602 Mar 4, 2024
199e4d7
🤖 Lint code
ivy-branch Mar 4, 2024
008b4c5
Update test_common.py
Sanjay8602 Mar 12, 2024
ece23a4
Update common.py
Sanjay8602 Mar 12, 2024
1a8b084
Update test_common.py
Sanjay8602 Mar 12, 2024
876dedc
Update test_common.py
Sanjay8602 Mar 12, 2024
419a459
Update common.py
Sanjay8602 Mar 13, 2024
a6b083c
🤖 Lint code
ivy-branch Mar 13, 2024
aa8a7b0
Update test_common.py
Sanjay8602 Mar 13, 2024
41fa740
Update test_common.py
Sanjay8602 Mar 14, 2024
490b363
🤖 Lint code
ivy-branch Mar 14, 2024
3899319
Update test_common.py
Sanjay8602 Mar 31, 2024
6fe0795
🤖 Lint code
ivy-branch Mar 31, 2024
8aee790
Update test_common.py
Sanjay8602 Apr 3, 2024
b3d8b36
🤖 Lint code
ivy-branch Apr 3, 2024
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
8 changes: 8 additions & 0 deletions ivy/functional/frontends/paddle/nn/functional/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
from ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back


@to_ivy_arrays_and_back
@with_supported_dtypes({"2.6.0 and below": ("float32", "float64")}, "paddle")
def bilinear(x1, x2, weight, bias=None, name=None):
x2_transposed = ivy.swapaxes(x2, -1, -2)
result = ivy.linear(ivy.multiply(x1, x2_transposed), weight, bias=bias)
return x1, x2_transposed, weight, bias, result


@to_ivy_arrays_and_back
@with_supported_dtypes({"2.6.0 and below": ("float32", "float64")}, "paddle")
def cosine_similarity(x1, x2, *, axis=1, eps=1e-08):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,41 @@ def paddle_unfold_handler(draw, dtype):
# ------------ #


# test function for bilinear
@handle_frontend_test(
fn_tree="paddle.nn.functional.common.bilinear",
dtype_x1_x2_weight_bias=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("valid", full=False),
num_arrays=5,
),
)
def test_paddle_bilinear(
*,
dtype_x1_x2_weight_bias,
on_device,
fn_tree,
backend_fw,
frontend,
test_flags,
):
dtype, x1, x2, weight, bias = dtype_x1_x2_weight_bias
Copy link
Contributor

Choose a reason for hiding this comment

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

dtype_and_values helper function return max 3 values,
please check the definition of it and use the appropriate helper function for generating the test data.

Copy link
Contributor

Choose a reason for hiding this comment

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

image

x2_transposed = ivy.swapaxes(x2, -1, -2)
result = ivy.linear(ivy.multiply(x1, x2_transposed), weight, bias=bias)
helpers.test_frontend_function(
input_dtypes=dtype,
frontend=frontend,
backend_to_test=backend_fw,
test_flags=test_flags,
fn_tree=fn_tree,
on_device=on_device,
x1=x1,
x2=x2,
weight=weight,
bias=bias,
result=result,
)


# Cosine Similarity
@handle_frontend_test(
fn_tree="paddle.nn.functional.common.cosine_similarity",
Expand Down
Loading