Tensorflow :: Status
#include <status.h>
Bezeichnet den Erfolg oder Misserfolg eines Anrufs in Tensorflow.
Zusammenfassung
Konstruktoren und Destruktoren | |
---|---|
Status () Erstellen Sie einen Erfolgsstatus. | |
Status (tensorflow::error::Code code, tensorflow::StringPiece msg) Erstellen Sie einen Status mit dem angegebenen Fehlercode und msg als lesbare Zeichenfolge mit detaillierteren Informationen. | |
Status (const Status & s) Kopieren Sie den angegebenen Status. |
Öffentliche Funktionen | |
---|---|
IgnoreError () const | void |
ToString () const | string Gibt eine Zeichenfolgendarstellung dieses Status zurück, die zum Drucken geeignet ist. |
Update (const Status & new_status) | void |
code () const | tensorflow::error::Code |
error_message () const | const string & |
ok () const | bool Gibt true zurück, wenn der Status Erfolg anzeigt. |
operator!= (const Status & x) const | bool |
operator= (const Status & s) | void |
operator== (const Status & x) const | bool |
Öffentliche statische Funktionen | |
---|---|
OK () |
Öffentliche Funktionen
IgnoreError
void IgnoreError() const
Status
Status()
Erstellen Sie einen Erfolgsstatus.
Status
Status( tensorflow::error::Code code, tensorflow::StringPiece msg )
Erstellen Sie einen Status mit dem angegebenen Fehlercode und msg als lesbare Zeichenfolge mit detaillierteren Informationen.
ToString
string ToString() const
Gibt eine Zeichenfolgendarstellung dieses Status zurück, die zum Drucken geeignet ist.
Gibt die Zeichenfolge "OK"
für den Erfolg zurück.
Aktualisieren
void Update( const Status & new_status )
Wenn ok()
, wird new_status
in *this
new_status
.
Wenn !ok()
, new_status
der aktuelle Status bei, kann jedoch mit zusätzlichen Informationen zu new_status
.
Bequeme Möglichkeit, den ersten aufgetretenen Fehler zu verfolgen. Anstelle von: if (overall_status.ok()) overall_status = new_status
Verwendung: overall_status.Update(new_status);
Code
tensorflow::error::Code code() const
Fehlermeldung
const string & error_message() const
OK
bool ok() const
Gibt true zurück, wenn der Status Erfolg anzeigt.
Operator! =
bool operator!=( const Status & x ) const
Operator =
void operator=( const Status & s )
operator ==
bool operator==( const Status & x ) const
Öffentliche statische Funktionen
OK
Status OK()