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

Function TFShapeToMklDnnDims

tensorflow/core/util/mkl_util.h:1072–1078  ·  view source on GitHub ↗

Map TensorShape object into memory::dims required by OneDNN This function will simply map input TensorShape into OneDNN dims naively. So it will preserve the order of dimensions. E.g., if input tensor is in NHWC format, then dims will be in NHWC format also. @input TensorShape object in shape @return memory::dims corresponding to TensorShape

Source from the content-addressed store, hash-verified

1070/// @input TensorShape object in shape
1071/// @return memory::dims corresponding to TensorShape
1072inline memory::dims TFShapeToMklDnnDims(const TensorShape& shape) {
1073 memory::dims dims(shape.dims());
1074 for (int d = 0; d < shape.dims(); ++d) {
1075 dims[d] = shape.dim_size(d);
1076 }
1077 return dims;
1078}
1079
1080/// Map TensorShape object into memory::dims in NCHW format required by OneDNN
1081///

Callers 15

ComputeMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
FindMklCommonFormatMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
MKLTransposeNDFunction · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
ComputeMethod · 0.85
CreateMatMulParamsMethod · 0.85

Calls 2

dimsMethod · 0.45
dim_sizeMethod · 0.45

Tested by

no test coverage detected