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

Method __init__

tensorflow/python/keras/layers/convolutional.py:2271–2298  ·  view source on GitHub ↗
(self, padding=(1, 1, 1), data_format=None, **kwargs)

Source from the content-addressed store, hash-verified

2269 """
2270
2271 def __init__(self, padding=(1, 1, 1), data_format=None, **kwargs):
2272 super(ZeroPadding3D, self).__init__(**kwargs)
2273 self.data_format = conv_utils.normalize_data_format(data_format)
2274 if isinstance(padding, int):
2275 self.padding = ((padding, padding), (padding, padding), (padding,
2276 padding))
2277 elif hasattr(padding, '__len__'):
2278 if len(padding) != 3:
2279 raise ValueError('`padding` should have 3 elements. '
2280 'Found: ' + str(padding))
2281 dim1_padding = conv_utils.normalize_tuple(padding[0], 2,
2282 '1st entry of padding')
2283 dim2_padding = conv_utils.normalize_tuple(padding[1], 2,
2284 '2nd entry of padding')
2285 dim3_padding = conv_utils.normalize_tuple(padding[2], 2,
2286 '3rd entry of padding')
2287 self.padding = (dim1_padding, dim2_padding, dim3_padding)
2288 else:
2289 raise ValueError(
2290 '`padding` should be either an int, '
2291 'a tuple of 3 ints '
2292 '(symmetric_dim1_pad, symmetric_dim2_pad, symmetric_dim3_pad), '
2293 'or a tuple of 3 tuples of 2 ints '
2294 '((left_dim1_pad, right_dim1_pad),'
2295 ' (left_dim2_pad, right_dim2_pad),'
2296 ' (left_dim3_pad, right_dim2_pad)). '
2297 'Found: ' + str(padding))
2298 self.input_spec = InputSpec(ndim=5)
2299
2300 def compute_output_shape(self, input_shape):
2301 input_shape = tensor_shape.TensorShape(input_shape).as_list()

Callers

nothing calls this directly

Calls 2

InputSpecClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected