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

Function StridedBound

tensorflow/compiler/xla/window_util.cc:248–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248int64 StridedBound(int64 bound, int64 window_size, int64 stride) {
249 CHECK_GE(window_size, 0);
250 CHECK_GE(bound, 0);
251 CHECK_GE(stride, 1);
252
253 if (bound == 0 || window_size > bound) {
254 return 0;
255 }
256
257 // Without considering stride, the maximum valid offset is bound -
258 // window_size. Taking stride into account, the valid offsets then have the
259 // form q * stride for q = 0, ..., Q such that q * stride <= bound -
260 // window_size. This implies that Q equals floor(bound - window_size /
261 // stride). There are Q + 1 valid values of q, yielding the formula below.
262 return (bound - window_size) / stride + 1;
263}
264
265} // namespace window_util
266} // namespace xla

Callers 4

WindowCountMethod · 0.85
ReduceWindow1DGenericMethod · 0.85
ReduceWindow4DGenericMethod · 0.85
InferWindowOutputShapeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected