def _fprop_slice_np(h, stride, H, roi_offset):
 hstart = int(np.floor((float(h) * stride)))
 hend = int(np.ceil((float((h + 1)) * stride)))
 hstart = min(max((hstart + roi_offset), 0), H)
 hend = min(max((hend + roi_offset), 0), H)
 return (slice(hstart, hend), (hend - hstart))

def _fprop_slice_np ( h , stride , H , roi_offset ) : hstart = int ( np . floor ( ( float ( h ) * stride ) ) ) hend = int ( np . ceil ( ( float ( ( h + 1 ) ) * stride ) ) ) hstart = min ( max ( ( hstart + roi_offset ) , 0 ) , H ) hend = min ( max ( ( hend + roi_offset ) , 0 ) , H ) return ( slice ( hstart , hend ) , ( hend - hstart ) )
slicing in this 1 dimension h: is the index on the pooled map stride: h: the max of the input map roi_offset: how far hstart is from 0 .