paddle/gserver/layers/LinearChainCRF.cpp
static real normalizeL1(real* x, int n) {
  real sum = 0;
  for (int i = 0; i < n; ++i) {
    sum += x[i];
  }
  // Right now, we just bet that sum won't be zero. If this really happens,
  // we will figure out what should be done then.
  CHECK_GT(sum, 0);
  real s = 1 / sum;
  for (int i = 0; i < n; ++i) {
    x[i] *= s;
  }
  return sum;
}
// normalize x so that its sum is 1 and return the original sum;
normalize x so that its sum is 1 and return the original sum.
normalize x so that its sum is 1 and return the original sum .
static real normalizeL1(real* x, int n) {
  real sum = 0;
  for (int i = 0; i < n; ++i) {
    sum += x[i];
  }
  CHECK_GT(sum, 0);
  real s = 1 / sum;
  for (int i = 0; i < n; ++i) {
    x[i] *= s;
  }
  return sum;
}
static real normalizeL1 ( real * x , int n ) { real sum = 0 ; for ( int i = 0 ; i < n ; ++ i ) { sum += x [ i ] ; } CHECK_GT ( sum , 0 ) ; real s = 1 / sum ; for ( int i = 0 ; i < n ; ++ i ) { x [ i ] *= s ; } return sum ; }
normalize x so that its sum is 1 and return the original sum;
normalize x so that its sum is 1 and return the original sum ;
// Right now, we just bet that sum won't be zero. If this really happens, // we will figure out what should be done then.