tensorflow/lite/toco/graph_transformations/resolve_constant_concatenation.cc
// Sets the minimum and maximum values for the concatenated array. If it's
// already set (e.g. because of previous pass in TOCO), it doesn't change it and
// returns. Otherwise it uses the input arrays min and max values to compute the
// concatenated array min and max.
Sets the minimum and maximum values for the concatenated array. If it's
already set , it doesn't change it and
returns. Otherwise it uses the input arrays min and max values to compute the
concatenated array min and max.
Sets the minimum and maximum values for the concatenated array . If it ' s already set it doesn ' t change it and returns . Otherwise it uses the input arrays min and max values to compute the concatenated array min and max .
void SetMinMaxForConcatenedArray(GraphTransformation* transformation,
                                 const std::vector<Array*>& input_arrays,
                                 Array* concatenated_array) {
  CHECK(concatenated_array->data_type == ArrayDataType::kFloat);
  if (concatenated_array->minmax) return;
  double concat_min = std::numeric_limits<double>::infinity();
  double concat_max = -std::numeric_limits<double>::infinity();
  for (Array* input_array : input_arrays) {
    if (!input_array->minmax) return;
    const MinMax& input_minmax = input_array->GetMinMax();
    concat_min = std::min(concat_min, input_minmax.min);
    concat_max = std::max(concat_max, input_minmax.max);
  }
  MinMax& minmax = concatenated_array->GetOrCreateMinMax();
  minmax.min = concat_min;
  minmax.max = concat_max;
  transformation->AddMessageF("Setting concatenated array min/max to %g,%g",
                              concat_min, concat_max);
}
void SetMinMaxForConcatenedArray ( GraphTransformation * transformation , const std :: vector < Array * > & input_arrays , Array * concatenated_array ) { CHECK ( concatenated_array -> data_type == ArrayDataType :: kFloat ) ; if ( concatenated_array -> minmax ) return ; double concat_min = std :: numeric_limits < double > :: infinity ( ) ; double concat_max = - std :: numeric_limits < double > :: infinity ( ) ; for ( Array * input_array : input_arrays ) { if ( ! input_array -> minmax ) return ; const MinMax & input_minmax = input_array -> GetMinMax ( ) ; concat_min = std :: min ( concat_min , input_minmax . min ) ; concat_max = std :: max ( concat_max , input_minmax . max ) ; } MinMax & minmax = concatenated_array -> GetOrCreateMinMax ( ) ; minmax . min = concat_min ; minmax . max = concat_max ; transformation -> AddMessageF ( " " , concat_min , concat_max ) ; }
Sets the minimum and maximum values for the concatenated array.
Sets the minimum and maximum values for the concatenated array .
// If the minmax is already set, use it // If any of the input arrays minmax is not set,  return. // TODO(ghodrat): shall we add the logic to compute the minmax?