Update nearest_interpolation_impl.hpp

This commit is contained in:
Abhinav-Aidash
2021-07-21 20:46:51 +05:30
committed by GitHub
parent 55b363833e
commit 289a4bdfa3
@@ -108,6 +108,16 @@ void NearestInterpolation<InputDataType, OutputDataType>::Backward(
assert(output.n_cols == batchSize);
}
if (gradient.is_empty())
{
gradient.set_size(outRowSize * outColSize * depth, batchSize);
}
else
{
assert(gradient.n_rows == outRowSize * outColSize * depth);
assert(gradient.n_cols == batchSize);
}
assert(outRowSize >= 2);
assert(outColSize >= 2);