Skip to content
Snippets Groups Projects
Commit 943081f8 authored by Charles Villard's avatar Charles Villard Committed by Maxence Naud
Browse files

edit: ILayerNormImpl: fixed type possible overflow warning

parent 1992ac67
No related branches found
No related tags found
2 merge requests!75Update 0.5.1 -> 0.6.0,!40Fix template compilation and warnings
......@@ -61,7 +61,8 @@ __global__ void ILayerNormforward_(T* input, double SF, int* dims, int* quantize
{
k = floorf((k + floorf(sum / k))/2);
}
int factor = (((1 << 31) - 1) / k);
unsigned int factor = (((1u << 31) - 1) / k);
for (int i = 0; i < dims[3]; i++) {
int idx = maxIdx + i;
square_tensor[idx] = (biase[idx]/weight[idx])/new_SF;
......@@ -339,4 +340,4 @@ void ILayerNormbackward<double>(const double* input_tensor, const double* output
cudaFree(bias_grad_);
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment