Skip to content

Commit 6ab5aa1

Browse files
committed
fix: add inplace support to torch.nn.functional.celu frontend
1 parent b507e89 commit 6ab5aa1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ivy/functional/frontends/torch/nn/functional/non_linear_activation_functions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
"torch",
1616
)
1717
def celu(input, alpha=1.0, inplace=False):
18-
return ivy.celu(input, alpha=alpha)
18+
ret = ivy.celu(input, alpha=alpha)
19+
if inplace:
20+
return ivy.inplace_update(input, ret)
21+
return ret
1922

2023

2124
def celu_(input, alpha=1.0):

ivy_tests/test_ivy/test_frontends/test_torch/test_nn/test_functional/test_non_linear_activation_functions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ def _x_and_scaled_attention(draw, dtypes):
108108
min_num_dims=1,
109109
),
110110
alpha=helpers.floats(min_value=0.1, max_value=1.0),
111-
test_inplace=st.booleans(),
112111
test_with_out=st.just(False),
113112
)
114113
def test_torch_celu(

0 commit comments

Comments
 (0)