提交 5c2318a9 编写于 作者: Y yangyaming

Add unit test for python wrapper.

上级 fedaa656
...@@ -1985,7 +1985,8 @@ def row_conv(input, future_context_size, param_attr=None, act=None): ...@@ -1985,7 +1985,8 @@ def row_conv(input, future_context_size, param_attr=None, act=None):
In the above equation: In the above equation:
* :math:`Out_{i}`: The i-th row of output variable with shape [1, D]. * :math:`Out_{i}`: The i-th row of output variable with shape [1, D].
* :math:`\\tau`: Future context size. * :math:`\\tau`: Future context size. Please note, the shape of
convolution kernel is [future_context_size + 1, D].
* :math:`X_{j}`: The j-th row of input variable with shape [1, D]. * :math:`X_{j}`: The j-th row of input variable with shape [1, D].
* :math:`W_{i-j}`: The (i-j)-th row of parameters with shape [1, D]. * :math:`W_{i-j}`: The (i-j)-th row of parameters with shape [1, D].
......
...@@ -225,6 +225,14 @@ class TestBook(unittest.TestCase): ...@@ -225,6 +225,14 @@ class TestBook(unittest.TestCase):
self.assertIsNotNone(out) self.assertIsNotNone(out)
print(str(program)) print(str(program))
def test_row_conv(self):
program = Program()
with program_guard(program):
x = layers.data(name='x', shape=[16], dtype='float32', lod_level=1)
out = layers.row_conv(input=x, future_context_size=2)
self.assertIsNotNone(out)
print(str(program))
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册