Source code for cvnets.layers.activation.swish

#
# For licensing see accompanying LICENSE file.
# Copyright (C) 2023 Apple Inc. All Rights Reserved.
#

from typing import Optional

from torch import Tensor, nn

from cvnets.layers.activation import register_act_fn


[docs]@register_act_fn(name="swish") class Swish(nn.SiLU): """ Applies the `Swish (also known as SiLU) <https://arxiv.org/abs/1702.03118>`_ function. """
[docs] def __init__(self, inplace: Optional[bool] = False, *args, **kwargs) -> None: super().__init__(inplace=inplace)