Map OneDNN data format into TensorFlow data format @input: OneDNN data format @return: Tensorflow data format corresponding to OneDNN data format; Fails with an error if invalid data format.
| 1048 | /// @return: Tensorflow data format corresponding to OneDNN data format; |
| 1049 | /// Fails with an error if invalid data format. |
| 1050 | inline TensorFormat MklDnnDataFormatToTFDataFormat(MklTensorFormat format) { |
| 1051 | if (format == MklTensorFormat::FORMAT_NHWC || |
| 1052 | format == MklTensorFormat::FORMAT_NDHWC) |
| 1053 | return FORMAT_NHWC; |
| 1054 | if (format == MklTensorFormat::FORMAT_NCHW || |
| 1055 | format == MklTensorFormat::FORMAT_NCDHW) |
| 1056 | return FORMAT_NCHW; |
| 1057 | TF_CHECK_OK(Status(error::Code::INVALID_ARGUMENT, "Unsupported data format")); |
| 1058 | |
| 1059 | // Return to prevent compiler warnings, otherwise TF_CHECK_OK will ensure |
| 1060 | // that we don't come here. |
| 1061 | return FORMAT_NHWC; |
| 1062 | } |
| 1063 | |
| 1064 | /// Map TensorShape object into memory::dims required by OneDNN |
| 1065 | /// |
no test coverage detected