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

Function ComputePadding

tensorflow/lite/kernels/padding.h:23–28  ·  view source on GitHub ↗

TODO(renjieliu): Migrate others to use ComputePaddingWithLeftover.

Source from the content-addressed store, hash-verified

21
22// TODO(renjieliu): Migrate others to use ComputePaddingWithLeftover.
23inline int ComputePadding(int stride, int dilation_rate, int in_size,
24 int filter_size, int out_size) {
25 int effective_filter_size = (filter_size - 1) * dilation_rate + 1;
26 int padding = ((out_size - 1) * stride + effective_filter_size - in_size) / 2;
27 return padding > 0 ? padding : 0;
28}
29
30// It's not guaranteed that padding is symmetric. It's important to keep
31// offset for algorithms need all paddings.

Callers 4

CalculateOpDataFunction · 0.85
CalculateOpDataFunction · 0.85
CalculateOpDataFunction · 0.85
TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.68