fix the 0.0f initialization for double

This commit is contained in:
lancer 2024-04-18 19:35:34 -07:00
parent e991fe1efa
commit 0c92ea9b90

View file

@ -71,7 +71,7 @@ void matmul_backward_cpu(float* dinp, float* dweight, float* dbias,
__global__ void matmul_backward_bias_kernel_naive(float* dbias, const float* dout, int B, int T, int OC) {
int o = blockIdx.x * blockDim.x + threadIdx.x;
if (o < OC) {
double sum = ;
double sum = 0.0;
for (int b = 0; b < B; b++) {
for (int t = 0; t < T; t++) {
sum += dout[b * T * OC + t * OC + o];