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

Function ComputeOutSize

tensorflow/lite/kernels/padding.h:44–55  ·  view source on GitHub ↗

Matching GetWindowedOutputSize in TensorFlow.

Source from the content-addressed store, hash-verified

42
43// Matching GetWindowedOutputSize in TensorFlow.
44inline int ComputeOutSize(TfLitePadding padding, int image_size,
45 int filter_size, int stride, int dilation_rate = 1) {
46 int effective_filter_size = (filter_size - 1) * dilation_rate + 1;
47 switch (padding) {
48 case kTfLitePaddingSame:
49 return (image_size + stride - 1) / stride;
50 case kTfLitePaddingValid:
51 return (image_size + stride - effective_filter_size) / stride;
52 default:
53 return 0;
54 }
55}
56
57inline TfLitePaddingValues ComputePaddingHeightWidth(
58 int stride_height, int stride_width, int dilation_rate_height,

Callers 3

EvalFunction · 0.85
EvalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected