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)
| 4629 | |
| 4630 | |
| 4631 | def _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 | |
| 4650 | def _preprocess_padding(padding): |
no test coverage detected