MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / temporal_padding

Function temporal_padding

tensorflow/python/keras/backend.py:2984–2997  ·  view source on GitHub ↗

Pads the middle dimension of a 3D tensor. Arguments: x: Tensor or variable. padding: Tuple of 2 integers, how many zeros to add at the start and end of dim 1. Returns: A padded 3D tensor.

(x, padding=(1, 1))

Source from the content-addressed store, hash-verified

2982
2983@keras_export('keras.backend.temporal_padding')
2984def temporal_padding(x, padding=(1, 1)):
2985 """Pads the middle dimension of a 3D tensor.
2986
2987 Arguments:
2988 x: Tensor or variable.
2989 padding: Tuple of 2 integers, how many zeros to
2990 add at the start and end of dim 1.
2991
2992 Returns:
2993 A padded 3D tensor.
2994 """
2995 assert len(padding) == 2
2996 pattern = [[0, 0], [padding[0], padding[1]], [0, 0]]
2997 return array_ops.pad(x, pattern)
2998
2999
3000@keras_export('keras.backend.spatial_2d_padding')

Callers 1

conv1dFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected