Is it OK to accept nan value as max value?
I do not think this natural, so could anyone tell me why?

  
      github.com
  
  
    pytorch/pytorch/blob/8b798f43e30d17f34b0af11c3fd17f7832003c46/aten/src/ATen/native/AdaptiveMaxPooling2d.cpp#L70 1



/* compute local max: */
int64_t maxindex = -1;
scalar_t maxval = -std::numeric_limits<float>::max();
int ih, iw;
for(ih = 0; ih < kH; ih++)
{
  for(iw = 0; iw < kW; iw++)
  {
    scalar_t val = *(ip + ih*istrideH + iw*istrideW);
    if ((val > maxval) || std::isnan(val))
    {
      maxval = val;
      maxindex = (ih+istartH)*isizeW + (iw+istartW);
    }
  }
}


/* set output to local max */
*op = maxval;