tensorflow/contrib/lite/toco/graph_transformations/hardcode_min_max.cc
// The output of average or max pooling is within the same range as its input.
The output of average or max pooling is within the same range as its input.
The output of average or max pooling is within the same range as its input .
bool HardcodeMinMaxForAverageOrMaxPool(Model* model, Operator* op) {
  auto& output_array = model->GetArray(op->outputs[0]);
  if (output_array.minmax) {
    return false;
  }
  const auto& input_array = model->GetArray(op->inputs[0]);
  if (!input_array.minmax) {
    return false;
  }
  const auto& input_minmax = input_array.GetMinMax();
  CHECK(!output_array.minmax);
  auto& output_minmax = output_array.GetOrCreateMinMax();
  output_minmax.min = std::min(input_minmax.min, 0.);
  output_minmax.max = std::max(input_minmax.max, 0.);
  return true;
}
bool HardcodeMinMaxForAverageOrMaxPool ( Model * model , Operator * op ) { auto & output_array = model -> GetArray ( op -> outputs [ 0 ] ) ; if ( output_array . minmax ) { return false ; } const auto & input_array = model -> GetArray ( op -> inputs [ 0 ] ) ; if ( ! input_array . minmax ) { return false ; } const auto & input_minmax = input_array . GetMinMax ( ) ; CHECK ( ! output_array . minmax ) ; auto & output_minmax = output_array . GetOrCreateMinMax ( ) ; output_minmax . min = std :: min ( input_minmax . min , 0. ) ; output_minmax . max = std :: max ( input_minmax . max , 0. ) ; return true ; }
The output of average or max pooling is within the same range as its input.
The output of average or max pooling is within the same range as its input .