File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -126,18 +126,15 @@ class LPPoolGrad {
126126
127127/* used for adaptive pool to calculate start and end index of each divided grid
128128 */
129- template <typename T = int >
129+ template <typename T = int64_t >
130130HOSTDEVICE inline T AdaptStartIndex (T ph, T input_size, T output_size) {
131- return static_cast <T>(
132- floor (static_cast <float >(ph * input_size) / output_size));
131+ return (ph * input_size) / output_size;
133132}
134133
135- template <typename T = int >
134+ template <typename T = int64_t >
136135HOSTDEVICE inline T AdaptEndIndex (T ph, T input_size, T output_size) {
137- return static_cast <T>(
138- ceil (static_cast <float >((ph + 1 ) * input_size) / output_size));
136+ return ((ph + 1 ) * input_size + output_size - 1 ) / output_size;
139137}
140-
141138/* used for fractional pool to calculate start and end index of each divided
142139 * grid
143140 */
You can’t perform that action at this time.
0 commit comments