mindspore.ops.HSwish
- class mindspore.ops.HSwish[source]
Hard swish activation function.
Refer to
mindspore.ops.hardswish()
for more details.- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> hswish = ops.HSwish() >>> input_x = Tensor(np.array([-1, -2, 0, 2, 1]), mindspore.float16) >>> result = hswish(input_x) >>> print(result) [-0.3333 -0.3333 0 1.666 0.6665]