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

Function TFDataFormatToMklDnnDataFormat

tensorflow/core/util/mkl_util.h:1038–1043  ·  view source on GitHub ↗

Map TensorFlow data format into OneDNN data format @input: TensorFlow data format @return: OneDNN data format corresponding to TensorFlow data format; Fails with an error if invalid data format.

Source from the content-addressed store, hash-verified

1036/// @return: OneDNN data format corresponding to TensorFlow data format;
1037/// Fails with an error if invalid data format.
1038inline MklTensorFormat TFDataFormatToMklDnnDataFormat(TensorFormat format) {
1039 if (format == FORMAT_NHWC) return MklTensorFormat::FORMAT_NHWC;
1040 if (format == FORMAT_NCHW) return MklTensorFormat::FORMAT_NCHW;
1041 TF_CHECK_OK(Status(error::Code::INVALID_ARGUMENT, "Unsupported data format"));
1042 return MklTensorFormat::FORMAT_INVALID;
1043}
1044
1045/// Map OneDNN data format into TensorFlow data format
1046///

Callers 9

ComputeMethod · 0.85
MklPoolingOpBaseMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
MklDnnDimsInNCHWFunction · 0.85
MklDnnDimsInNCDHWFunction · 0.85

Calls 1

StatusClass · 0.50

Tested by

no test coverage detected