Gets the activation function.
name (str) – The name of the activation function.
prim_name (Union[str, None]) – The name of primitive. Default: None .
None
Function, the activation function.
Ascend GPU CPU
Ascend
GPU
CPU
Examples
>>> import mindspore.nn as nn >>> sigmoid = nn.get_activation('sigmoid') >>> print(sigmoid) Sigmoid<>