tensorflow/core/kernels/string_util.cc
// Sets unit value based on str.
Sets unit value based on str.
Sets unit value based on str .
Status ParseCharUnit(const string& str, CharUnit* unit) {
  if (str == "BYTE") {
    *unit = CharUnit::BYTE;
  } else if (str == "UTF8_CHAR") {
    *unit = CharUnit::UTF8_CHAR;
  } else {
    return errors::InvalidArgument(strings::StrCat(
        "Invalid unit \"", str, "\": Should be one of: BYTE, UTF8_CHAR"));
  }
  return Status::OK();
}
Status ParseCharUnit ( const string & str , CharUnit * unit ) { if ( str == " " ) { * unit = CharUnit :: BYTE ; } else if ( str == " " ) { * unit = CharUnit :: UTF8_CHAR ; } else { return errors :: InvalidArgument ( strings :: StrCat ( " \" " , str , " \" " ) ) ; } return Status :: OK ( ) ; }
Sets unit value based on str.
Sets unit value based on str .