Overloaded version of function TFShapeToMklDnnDimsInNCHW above. Input parameters are self-explanatory.
| 1120 | /// Overloaded version of function TFShapeToMklDnnDimsInNCHW above. |
| 1121 | /// Input parameters are self-explanatory. |
| 1122 | inline memory::dims MklDnnDimsInNCHW(const memory::dims& in_dims, |
| 1123 | TensorFormat format) { |
| 1124 | // Validate format. |
| 1125 | DCHECK_NE(TFDataFormatToMklDnnDataFormat(format), |
| 1126 | MklTensorFormat::FORMAT_INVALID); |
| 1127 | |
| 1128 | int n = in_dims[GetTensorDimIndex(format, 'N')]; |
| 1129 | int c = in_dims[GetTensorDimIndex(format, 'C')]; |
| 1130 | int h = in_dims[GetTensorDimIndex(format, 'H')]; |
| 1131 | int w = in_dims[GetTensorDimIndex(format, 'W')]; |
| 1132 | |
| 1133 | // OneDNN requires dimensions in NCHW format. |
| 1134 | return memory::dims({n, c, h, w}); |
| 1135 | } |
| 1136 | |
| 1137 | /// Overloaded version of function TFShapeToMklDnnDimsInNCDHW above. |
| 1138 | /// Input parameters are self-explanatory. |
no test coverage detected