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

Function MklDnnDimsInNCHW

tensorflow/core/util/mkl_util.h:1122–1135  ·  view source on GitHub ↗

Overloaded version of function TFShapeToMklDnnDimsInNCHW above. Input parameters are self-explanatory.

Source from the content-addressed store, hash-verified

1120/// Overloaded version of function TFShapeToMklDnnDimsInNCHW above.
1121/// Input parameters are self-explanatory.
1122inline 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.

Callers 2

ComputeMethod · 0.85
ComputeMklSliceMethod · 0.85

Calls 3

GetTensorDimIndexFunction · 0.85
dimsFunction · 0.85

Tested by

no test coverage detected