@@ -1850,6 +1850,22 @@ def test_forward_log():
18501850 tf .log (in_data , name = "log" )
18511851 compare_tf_with_tvm ([np_data ], ['in_data:0' ], 'log:0' )
18521852
1853+ def test_forward_log1p ():
1854+ """test operator Log1p """
1855+ np_data = np .random .uniform (1 , 100 , size = (2 , 3 , 5 )).astype (np .float32 )
1856+ tf .reset_default_graph ()
1857+ in_data = tf .placeholder (tf .float32 , (2 , 3 , 5 ), name = "in_data" )
1858+ tf .log1p (in_data , name = "log1p" )
1859+ compare_tf_with_tvm ([np_data ], ['in_data:0' ], 'log1p:0' )
1860+
1861+ def test_forward_cos ():
1862+ """test operator cos """
1863+ np_data = np .random .uniform (1 , 100 , size = (2 , 3 , 5 )).astype (np .float32 )
1864+ tf .reset_default_graph ()
1865+ in_data = tf .placeholder (tf .float32 , (2 , 3 , 5 ), name = "in_data" )
1866+ tf .cos (in_data , name = "cos" )
1867+ compare_tf_with_tvm ([np_data ], ['in_data:0' ], 'cos:0' )
1868+
18531869def test_forward_negative ():
18541870 """test tf operator Neg """
18551871 np_data = np .random .uniform (- 100 , 255 , size = (224 , 224 , 3 )).astype (np .float32 )
@@ -2097,6 +2113,7 @@ def test_placeholder():
20972113# ----
20982114if __name__ == '__main__' :
20992115
2116+
21002117 # Transforms
21012118 test_forward_transpose ()
21022119 test_forward_reshape ()
@@ -2140,6 +2157,8 @@ def test_placeholder():
21402157 test_forward_pow_exp ()
21412158 test_forward_sign ()
21422159 test_forward_log ()
2160+ test_forward_log1p ()
2161+ test_forward_cos ()
21432162 test_forward_negative ()
21442163 test_forward_divide ()
21452164 test_forward_abs ()
0 commit comments