Skip to content

Commit 64f965e

Browse files
authored
tensorflow: add Activation, GlobalAveragePooling2D and MaxPool2D layers (#15302)
1 parent d2154f5 commit 64f965e

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

stubs/tensorflow/tensorflow/keras/layers/__init__.pyi

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,4 +443,48 @@ class GaussianDropout(Layer[tf.Tensor, tf.Tensor]):
443443
name: str | None = None,
444444
) -> None: ...
445445

446+
class Activation(Layer[tf.Tensor, tf.Tensor]):
447+
def __init__(
448+
self,
449+
activation: _Activation = None,
450+
*,
451+
# **kwargs passed to Layer
452+
# **kwargs passed to Layer
453+
activity_regularizer: _Regularizer = None,
454+
trainable: bool = True,
455+
dtype: _LayerDtype | None = None,
456+
autocast: bool = True,
457+
name: str | None = None,
458+
) -> None: ...
459+
460+
class GlobalAveragePooling2D(Layer[tf.Tensor, tf.Tensor]):
461+
def __init__(
462+
self,
463+
data_format: Literal["channels_last", "channels_first"] | None = None,
464+
keepdims: bool = False,
465+
*,
466+
# **kwargs passed to Layer
467+
activity_regularizer: _Regularizer = None,
468+
trainable: bool = True,
469+
dtype: _LayerDtype | None = None,
470+
autocast: bool = True,
471+
name: str | None = None,
472+
) -> None: ...
473+
474+
class MaxPool2D(Layer[tf.Tensor, tf.Tensor]):
475+
def __init__(
476+
self,
477+
pool_size: int | tuple[int, int] = (2, 2),
478+
strides: int | tuple[int, int] | None = None,
479+
padding: Literal["valid", "same"] = "valid",
480+
data_format: Literal["channels_last", "channels_first"] | None = None,
481+
*,
482+
# **kwargs passed to Layer
483+
activity_regularizer: _Regularizer = None,
484+
trainable: bool = True,
485+
dtype: _LayerDtype | None = None,
486+
autocast: bool = True,
487+
name: str | None = None,
488+
) -> None: ...
489+
446490
def __getattr__(name: str): ... # incomplete module

0 commit comments

Comments
 (0)