Skip to content

Commit 06f5932

Browse files
committed
add tensorflow.pad
fix typo
1 parent f80f9c2 commit 06f5932

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

stubs/tensorflow/tensorflow/__init__.pyi

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
66
from contextlib import contextmanager
77
from enum import Enum
88
from types import TracebackType
9-
from typing import Any, Generic, NoReturn, TypeVar, overload
9+
from typing import Any, Generic, Literal, NoReturn, TypeVar, overload
1010
from typing_extensions import ParamSpec, Self
1111

1212
from google.protobuf.message import Message
@@ -20,7 +20,7 @@ from tensorflow import (
2020
math as math,
2121
types as types,
2222
)
23-
from tensorflow._aliases import AnyArray, DTypeLike, ShapeLike, Slice, TensorCompatible
23+
from tensorflow._aliases import AnyArray, DTypeLike, ScalarTensorCompatible, ShapeLike, Slice, TensorCompatible
2424
from tensorflow.autodiff import GradientTape as GradientTape
2525
from tensorflow.core.protobuf import struct_pb2
2626
from tensorflow.dtypes import *
@@ -404,4 +404,11 @@ def ones_like(
404404
input: RaggedTensor, dtype: DTypeLike | None = None, name: str | None = None, layout: Layout | None = None
405405
) -> RaggedTensor: ...
406406
def reshape(tensor: TensorCompatible, shape: ShapeLike | Tensor, name: str | None = None) -> Tensor: ...
407+
def pad(
408+
tensor: TensorCompatible,
409+
paddings: ShapeLike,
410+
mode: Literal["CONSTANT", "constant", "REFLECT", "reflect", "SYMMETRIC", "symmectric"] = "CONSTANT",
411+
constant_values: ScalarTensorCompatible = 0,
412+
name: str | None = None,
413+
) -> Tensor: ...
407414
def __getattr__(name: str) -> Incomplete: ...

0 commit comments

Comments
 (0)