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

Method Init

tensorflow/core/kernels/mkl_pooling_ops_common.cc:225–249  ·  view source on GitHub ↗

Initialization for TensorFlow format

Source from the content-addressed store, hash-verified

223
224// Initialization for TensorFlow format
225void MklPoolParameters::Init(OpKernelContext* context,
226 const std::vector<int32>& ksize,
227 const std::vector<int32>& stride, Padding padding,
228 TensorFormat data_format,
229 const TensorShape& tensor_in_shape) {
230 // For max pooling, tensor_in should have 4 or 5 dimensions.
231 OP_REQUIRES(context,
232 tensor_in_shape.dims() == 4 || tensor_in_shape.dims() == 5,
233 errors::InvalidArgument("tensor_in must be 4 or 5-dimensional"));
234
235 depth = GetTensorDim(tensor_in_shape, data_format, 'C');
236 if (tensor_in_shape.dims() == 4) {
237 // Pool2D
238 tensor_in_cols = GetTensorDim(tensor_in_shape, data_format, 'W');
239 tensor_in_rows = GetTensorDim(tensor_in_shape, data_format, 'H');
240 } else {
241 // Pool3D
242 tensor_in_planes = GetTensorDim(tensor_in_shape, data_format, '0');
243 tensor_in_rows = GetTensorDim(tensor_in_shape, data_format, '1');
244 tensor_in_cols = GetTensorDim(tensor_in_shape, data_format, '2');
245 }
246 tensor_in_batch = GetTensorDim(tensor_in_shape, data_format, 'N');
247
248 Init(context, ksize, stride, padding, data_format);
249}
250
251// Initialization for OneDNN format.
252void MklPoolParameters::Init(OpKernelContext* context,

Callers 15

ConcatGPUCallFunction · 0.45
PhiloxRandomOpMethod · 0.45
RandomUniformIntOpMethod · 0.45
RandomGammaOpMethod · 0.45
ComputeMethod · 0.45
ComputeMethod · 0.45
TestCompactionFunction · 0.45
TestReadEmbFileFunction · 0.45
InitMklPoolParametersMethod · 0.45
operator()Method · 0.45

Calls 14

InvalidArgumentFunction · 0.85
GetTensorDimFunction · 0.85
UnimplementedFunction · 0.85
FastBoundsCheckFunction · 0.85
DeviceTypeClass · 0.85
GetDimension3DMethod · 0.80
InitFunction · 0.50
maxFunction · 0.50
dimsMethod · 0.45
sizeMethod · 0.45
GetDimensionMethod · 0.45

Tested by 3

TestCompactionFunction · 0.36
TestReadEmbFileFunction · 0.36
CreateEmbeddingVarFunction · 0.36