Skip to content
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
2 changes: 1 addition & 1 deletion python/paddle/tensor/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def acos(x, name=None):
Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
[1.98231316, 1.77215421, 1.47062886, 1.26610363])
"""
if in_dynamic_mode():
if in_dynamic_or_pir_mode():
return _C_ops.acos(x)
else:
check_variable_and_dtype(
Expand Down
11 changes: 7 additions & 4 deletions test/legacy_test/test_activation_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -2035,13 +2035,16 @@ def setUp(self):
def init_shape(self):
self.shape = [10, 12]

def test_check_output(self):
self.check_output(check_pir=True)

def test_check_grad(self):
if self.dtype == np.float16:
return
self.check_grad(['X'], 'Out')
self.check_grad(['X'], 'Out', check_pir=True)


class TestAcos_Comple64(TestAcos):
class TestAcos_Complex64(TestAcos):
def init_dtype(self):
self.dtype = np.complex64

Expand Down Expand Up @@ -4709,7 +4712,7 @@ def test_check_grad(self):
create_test_act_fp16_class(TestCos, check_pir=True)
create_test_act_fp16_class(TestTan)
create_test_act_fp16_class(TestCosh)
create_test_act_fp16_class(TestAcos)
create_test_act_fp16_class(TestAcos, check_pir=True)
create_test_act_fp16_class(TestSin, check_pir=True)
create_test_act_fp16_class(TestSinh)
create_test_act_fp16_class(TestAsin)
Expand Down Expand Up @@ -4863,7 +4866,7 @@ def test_check_grad(self):
create_test_act_bf16_class(TestCos, check_pir=True)
create_test_act_bf16_class(TestTan)
create_test_act_bf16_class(TestCosh)
create_test_act_bf16_class(TestAcos)
create_test_act_bf16_class(TestAcos, check_pir=True)
create_test_act_bf16_class(TestSin, check_pir=True)
create_test_act_bf16_class(TestSinh)
create_test_act_bf16_class(TestAsin)
Expand Down