Skip to content

Commit 213e076

Browse files
authored
[0-size Tensor No.120、313] Add 0-size Tensor support for log (#72940)
* fix * add test
1 parent 1fd0aa4 commit 213e076

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/legacy_test/test_activation_op.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4055,6 +4055,29 @@ def init_shape(self):
40554055
self.shape = []
40564056

40574057

4058+
class TestLog_ZeroSize1(TestLog):
4059+
def init_shape(self):
4060+
self.shape = [0]
4061+
4062+
4063+
class TestLog_ZeroSize2(TestLog):
4064+
def init_shape(self):
4065+
self.shape = [0, 2]
4066+
4067+
def init_dtype(self):
4068+
self.dtype = np.float64
4069+
4070+
4071+
class TestLog_ZeroSize3(TestLog):
4072+
def init_shape(self):
4073+
self.shape = [1, 100, 0]
4074+
4075+
4076+
class TestLog_ZeroSize4(TestLog):
4077+
def init_shape(self):
4078+
self.shape = [1, 0, 300, 2]
4079+
4080+
40584081
class TestLog2(TestActivation):
40594082
def setUp(self):
40604083
self.op_type = "log2"

0 commit comments

Comments
 (0)