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

Function _preprocess_conv3d_input

tensorflow/python/keras/backend.py:4631–4647  ·  view source on GitHub ↗

Transpose and cast the input before the conv3d. Arguments: x: input tensor. data_format: string, `"channels_last"` or `"channels_first"`. Returns: A tensor.

(x, data_format)

Source from the content-addressed store, hash-verified

4629
4630
4631def _preprocess_conv3d_input(x, data_format):
4632 """Transpose and cast the input before the conv3d.
4633
4634 Arguments:
4635 x: input tensor.
4636 data_format: string, `"channels_last"` or `"channels_first"`.
4637
4638 Returns:
4639 A tensor.
4640 """
4641 tf_data_format = 'NDHWC'
4642 if data_format == 'channels_first':
4643 if not _has_nchw_support():
4644 x = array_ops.transpose(x, (0, 2, 3, 4, 1))
4645 else:
4646 tf_data_format = 'NCDHW'
4647 return x, tf_data_format
4648
4649
4650def _preprocess_padding(padding):

Callers 3

conv3dFunction · 0.85
conv3d_transposeFunction · 0.85
pool3dFunction · 0.85

Calls 2

_has_nchw_supportFunction · 0.85
transposeMethod · 0.80

Tested by

no test coverage detected