     parentIdx = (int)node[0] - 1;
     nChildren = (int)node[1];
     
+    CudaAssert(childIdx < nChildren)
     /* Linear */
     
     nodeWeight = weight + parentIdx*nInput;

    for (int j=tx; j<nChildren; j+=i_step)
    {
      // multiply accumulate biases
      atomicAdd(&nodeGradBias[j], scale*nodeGradOutput[j]);
      CudaAssert(isfinite(nodeGradBias[j]))
    }
    
    // keep track of which node gets gradients

      for (int j=0; j<nChildren; j++)
      {
        // multiply accumulate weights
        float dw = scale*nodeGradOutput[j]*buffer[tx];
        CudaAssert(isfinite(dw))
        atomicAdd(&nodeGradWeight[j*nInput + i], dw);
      }
    }
    
