interpolation hook returns wrong result when scale_factor
is scalar
#144
Labels
bug
Something isn't working
scale_factor
is scalar
#144
Consider following example:
To compute value of one element in output tensor bilinear interpolation spends 1 MaC (actually 4, but assume 1 for simplicity, support of "interpolation modes" is another issue). So it's expected that tensor of shape (2000, 3, 10, 10), when interpolated on spatial dimensions with scale = 2, will be of shape (2000, 3, 20, 20). So totally 2000 * 3 * 20 * 20 = 2.4 GMaC.
At the same time, call to
get_model_complexity_info
raisesOverflowError: int too large to convert to float
.Problem is caused by wrong computation in
_interpolate_fucntional_flops_hook
. In case of scalarscale_factor
following lines get called:So for
flops
to be equal to number of elements in output tensor, last line should be changed to:The text was updated successfully, but these errors were encountered: