未验证 提交 6d9607bb 编写于 作者: Q qingqing01 提交者: GitHub

Merge pull request #8065 from qingqing01/softmax_api

Add softmax into Python API.
......@@ -59,6 +59,7 @@ __all__ = [
'elementwise_pow',
'clip',
'clip_by_norm',
'softmax',
'sequence_softmax',
] + __activations__
......
......@@ -223,6 +223,14 @@ class TestBook(unittest.TestCase):
self.assertIsNotNone(layers.sequence_softmax(x=seq))
print(str(program))
def test_softmax(self):
program = Program()
with program_guard(program):
data = layers.data(name='data', shape=[10], dtype='float32')
hid = layers.fc(input=data, size=20)
self.assertIsNotNone(layers.softmax(x=hid))
print(str(program))
def test_get_places(self):
program = Program()
with program_guard(program):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册