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

Method SanityCheckInputs

tensorflow/core/kernels/mkl_lrn_op.cc:286–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284 }
285
286 void SanityCheckInputs(OpKernelContext* context) {
287 const Tensor& src_tensor = MklGetInput(context, kIdxInput);
288 MklDnnShape src_dnn_shape;
289 GetMklShape(context, kIdxInput, &src_dnn_shape);
290 if (src_dnn_shape.IsMklTensor()) {
291 OP_REQUIRES(context, src_dnn_shape.GetDimension() == 4,
292 errors::InvalidArgument("input must be 4-dimensional"));
293 OP_REQUIRES(context,
294 FastBoundsCheck(src_tensor.NumElements(),
295 std::numeric_limits<int>::max()),
296 errors::InvalidArgument("argument to LRN too large"));
297 } else {
298 OP_REQUIRES(context, src_tensor.dims() == 4,
299 errors::InvalidArgument("input must be 4-dimensional"));
300 OP_REQUIRES(context,
301 FastBoundsCheck(src_tensor.NumElements(),
302 std::numeric_limits<int>::max()),
303 errors::InvalidArgument("argument to LRN too large"));
304 }
305 }
306 const int kIdxInput = 0, kIdxOutput = 0, kIdxWorkspace = 1;
307
308 typedef typename Eigen::Tensor<T, 1, Eigen::RowMajor>::DimensionPair DimPair;

Callers

nothing calls this directly

Calls 8

GetMklShapeFunction · 0.85
InvalidArgumentFunction · 0.85
FastBoundsCheckFunction · 0.85
IsMklTensorMethod · 0.80
maxFunction · 0.50
GetDimensionMethod · 0.45
NumElementsMethod · 0.45
dimsMethod · 0.45

Tested by

no test coverage detected