fix description of 'get_activation' and some example

This commit is contained in:
dinglinhe 2021-06-09 18:27:35 +08:00
parent 899848362b
commit 18cdd5e2c8
2 changed files with 6 additions and 4 deletions

View File

@ -750,6 +750,8 @@ def get_activation(name):
Examples:
>>> sigmoid = nn.get_activation('sigmoid')
>>> print(sigmoid)
Sigmoid<>
"""
if name is None:
return None

View File

@ -2149,7 +2149,7 @@ def choose(a, choices, mode='clip'):
Examples:
>>> import mindspore.numpy as np
>>> choices = [[0, 1, 2, 3], [10, 11, 12, 13],
[20, 21, 22, 23], [30, 31, 32, 33]]
... [20, 21, 22, 23], [30, 31, 32, 33]]
>>> print(np.choose([2, 3, 1, 0], choices))
[20 31 12 3]
>>> print(np.choose([2, 4, 1, 0], choices, mode='clip'))