Skip to content

Commit

Permalink
[Typing][C-70] Add type annotations for `python/paddle/incubate/nn/fu…
Browse files Browse the repository at this point in the history
…nctional/fused_dropout_add.py` (PaddlePaddle#66279)


---------

Co-authored-by: Nyakku Shigure <sigure.qaq@gmail.com>
  • Loading branch information
2 people authored and inaomIIsfarell committed Jul 31, 2024
1 parent c462215 commit 22a6aa3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions python/paddle/incubate/nn/functional/fused_dropout_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from typing import TYPE_CHECKING, Literal

if TYPE_CHECKING:
from paddle import Tensor

from paddle import _C_ops
from paddle.base import core
Expand All @@ -20,8 +26,15 @@


def fused_dropout_add(
x, y, p=0.5, training=True, mode='upscale_in_train', name=None
):
x: Tensor,
y: Tensor,
p: float = 0.5,
training: bool = True,
mode: Literal[
'upscale_in_train', 'downscale_in_infer'
] = 'upscale_in_train',
name: str | None = None,
) -> Tensor:
r"""
Fused Dropout and Add.
Expand Down

0 comments on commit 22a6aa3

Please sign in to comment.