tf.keras.backend.spatial_2d_padding
Stay organized with collections
Save and categorize content based on your preferences.
Pads the 2nd and 3rd dimensions of a 4D tensor.
tf.keras.backend.spatial_2d_padding(
x, padding=((1, 1), (1, 1)), data_format=None
)
Arguments |
x
|
Tensor or variable.
|
padding
|
Tuple of 2 tuples, padding pattern.
|
data_format
|
One of channels_last or channels_first .
|
Returns |
A padded 4D tensor.
|
Raises |
ValueError
|
if data_format is neither
channels_last or channels_first .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.backend.spatial_2d_padding\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/keras/backend/spatial_2d_padding) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/backend.py#L3000-L3028) |\n\nPads the 2nd and 3rd dimensions of a 4D tensor.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.backend.spatial_2d_padding`](/api_docs/python/tf/keras/backend/spatial_2d_padding), \\`tf.compat.v2.keras.backend.spatial_2d_padding\\`\n\n\u003cbr /\u003e\n\n tf.keras.backend.spatial_2d_padding(\n x, padding=((1, 1), (1, 1)), data_format=None\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|---------------|---------------------------------------------|\n| `x` | Tensor or variable. |\n| `padding` | Tuple of 2 tuples, padding pattern. |\n| `data_format` | One of `channels_last` or `channels_first`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A padded 4D tensor. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|------------------------------------------------------------------|\n| `ValueError` | if `data_format` is neither `channels_last` or `channels_first`. |\n\n\u003cbr /\u003e"]]