Skip to content

Commit

Permalink
feat: Updated paddle version mapping form 2.5.2 to 2.6.0 (#27941)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sai-Suraj-27 authored Jan 18, 2024
1 parent 8d2f4d4 commit 7e42474
Show file tree
Hide file tree
Showing 57 changed files with 651 additions and 651 deletions.
2 changes: 1 addition & 1 deletion docs/overview/deep_dive/data_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ set of dtypes is not supported by a certain device.

.. code-block:: python
@with_unsupported_device_and_dtypes({"2.5.2 and below": {"cpu": ("int8", "int16", "uint8")}}, backend_version)
@with_unsupported_device_and_dtypes({"2.6.0 and below": {"cpu": ("int8", "int16", "uint8")}}, backend_version)
def gcd(
x1: Union[paddle.Tensor, int, list, tuple],
x2: Union[paddle.Tensor, float, list, tuple],
Expand Down
12 changes: 6 additions & 6 deletions ivy/functional/backends/paddle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def rep_method(*args, **kwargs):
),
}
valid_int_dtypes = {
"2.5.2 and below": (
"2.6.0 and below": (
ivy.int8,
ivy.int16,
ivy.int32,
Expand All @@ -187,8 +187,8 @@ def rep_method(*args, **kwargs):
"2.4.2 and below": (ivy.float16, ivy.float32, ivy.float64),
"2.5.0 and above": (ivy.bfloat16, ivy.float16, ivy.float32, ivy.float64),
}
valid_uint_dtypes = {"2.5.2 and below": (ivy.uint8,)}
valid_complex_dtypes = {"2.5.2 and below": (ivy.complex64, ivy.complex128)}
valid_uint_dtypes = {"2.6.0 and below": (ivy.uint8,)}
valid_complex_dtypes = {"2.6.0 and below": (ivy.complex64, ivy.complex128)}

# leave these untouched
valid_dtypes = _dtype_from_version(valid_dtypes, backend_version)
Expand Down Expand Up @@ -228,10 +228,10 @@ def rep_method(*args, **kwargs):
),
}

invalid_int_dtypes = {"2.5.2 and below": (ivy.uint16, ivy.uint32, ivy.uint64)}
invalid_int_dtypes = {"2.6.0 and below": (ivy.uint16, ivy.uint32, ivy.uint64)}
invalid_float_dtypes = {"2.4.2 and below": (ivy.bfloat16,), "2.5.0 and above": ()}
invalid_uint_dtypes = {"2.5.2 and below": (ivy.uint16, ivy.uint32, ivy.uint64)}
invalid_complex_dtypes = {"2.5.2 and below": ()}
invalid_uint_dtypes = {"2.6.0 and below": (ivy.uint16, ivy.uint32, ivy.uint64)}
invalid_complex_dtypes = {"2.6.0 and below": ()}

# leave these untouched
invalid_dtypes = _dtype_from_version(invalid_dtypes, backend_version)
Expand Down
18 changes: 9 additions & 9 deletions ivy/functional/backends/paddle/activations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


@with_supported_dtypes(
{"2.5.1 and below": ("float32", "float64", "complex")},
{"2.6.0 and below": ("float32", "float64", "complex")},
backend_version,
)
def relu(x: paddle.Tensor, /, *, out: Optional[paddle.Tensor] = None) -> paddle.Tensor:
Expand All @@ -32,7 +32,7 @@ def relu(x: paddle.Tensor, /, *, out: Optional[paddle.Tensor] = None) -> paddle.


@with_supported_device_and_dtypes(
{"2.5.2 and below": {"cpu": ("float32", "float64", "complex")}},
{"2.6.0 and below": {"cpu": ("float32", "float64", "complex")}},
backend_version,
)
def leaky_relu(
Expand All @@ -52,7 +52,7 @@ def leaky_relu(


@with_supported_device_and_dtypes(
{"2.5.2 and below": {"cpu": ("float32", "float64", "complex")}},
{"2.6.0 and below": {"cpu": ("float32", "float64", "complex")}},
backend_version,
)
def gelu(
Expand All @@ -76,7 +76,7 @@ def gelu(


@with_supported_device_and_dtypes(
{"2.5.2 and below": {"cpu": ("float32", "float64", "complex")}},
{"2.6.0 and below": {"cpu": ("float32", "float64", "complex")}},
backend_version,
)
def sigmoid(
Expand All @@ -88,7 +88,7 @@ def sigmoid(


@with_unsupported_device_and_dtypes(
{"2.5.2 and below": {"cpu": ("bfloat16", "float16")}}, backend_version
{"2.6.0 and below": {"cpu": ("bfloat16", "float16")}}, backend_version
)
def softmax(
x: paddle.Tensor,
Expand Down Expand Up @@ -138,7 +138,7 @@ def softplus(

# Softsign
@with_unsupported_device_and_dtypes(
{"2.5.2 and below": {"cpu": ("float16", "bfloat16")}}, backend_version
{"2.6.0 and below": {"cpu": ("float16", "bfloat16")}}, backend_version
)
def softsign(
x: paddle.Tensor,
Expand All @@ -152,7 +152,7 @@ def softsign(


@with_unsupported_device_and_dtypes(
{"2.5.2 and below": {"cpu": ("float16", "bfloat16")}}, backend_version
{"2.6.0 and below": {"cpu": ("float16", "bfloat16")}}, backend_version
)
def log_softmax(
x: paddle.Tensor,
Expand All @@ -171,7 +171,7 @@ def log_softmax(


@with_supported_device_and_dtypes(
{"2.5.2 and below": {"cpu": ("float32", "float64", "complex")}},
{"2.6.0 and below": {"cpu": ("float32", "float64", "complex")}},
backend_version,
)
def mish(
Expand All @@ -187,7 +187,7 @@ def mish(


@with_unsupported_device_and_dtypes(
{"2.5.2 and below": {"cpu": ("float16",)}}, backend_version
{"2.6.0 and below": {"cpu": ("float16",)}}, backend_version
)
def hardswish(
x: paddle.Tensor,
Expand Down
12 changes: 6 additions & 6 deletions ivy/functional/backends/paddle/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def empty_like(

@with_unsupported_device_and_dtypes(
{
"2.5.2 and below": {
"2.6.0 and below": {
"cpu": (
"uint8",
"int8",
Expand Down Expand Up @@ -356,7 +356,7 @@ def _slice_at_axis(sl, axis):


@with_unsupported_device_and_dtypes(
{"2.5.2 and below": {"cpu": ("uint16", "bfloat16", "float16")}}, backend_version
{"2.6.0 and below": {"cpu": ("uint16", "bfloat16", "float16")}}, backend_version
)
def linspace(
start: Union[paddle.Tensor, float],
Expand Down Expand Up @@ -414,7 +414,7 @@ def linspace(

@with_unsupported_device_and_dtypes(
{
"2.5.2 and below": {
"2.6.0 and below": {
"cpu": (
"int8",
"int16",
Expand Down Expand Up @@ -484,7 +484,7 @@ def ones_like(

@with_unsupported_device_and_dtypes(
{
"2.5.2 and below": {
"2.6.0 and below": {
"cpu": (
"int8",
"int16",
Expand All @@ -503,7 +503,7 @@ def tril(

@with_unsupported_device_and_dtypes(
{
"2.5.2 and below": {
"2.6.0 and below": {
"cpu": (
"int8",
"int16",
Expand Down Expand Up @@ -616,7 +616,7 @@ def one_hot(


@with_unsupported_device_and_dtypes(
{"2.5.2 and below": {"cpu": ("complex64", "complex128")}},
{"2.6.0 and below": {"cpu": ("complex64", "complex128")}},
backend_version,
)
def frombuffer(
Expand Down
2 changes: 1 addition & 1 deletion ivy/functional/backends/paddle/data_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def broadcast_arrays(*arrays: paddle.Tensor) -> List[paddle.Tensor]:

@with_unsupported_dtypes(
{
"2.5.1 and below": (
"2.6.0 and below": (
"uint8",
"int8",
"int16",
Expand Down
Loading

0 comments on commit 7e42474

Please sign in to comment.