#include <status.h>
Denotes success or failure of a call in Tensorflow.
Constructors and Destructors | |
---|---|
Status() Create a success status. | |
Status(tensorflow::error::Code code, tensorflow::StringPiece msg) Create a status with the specified error code and msg as a human-readable string containing more detailed information. | |
Status(const Status & s) Copy the specified status. |
Public functions | |
---|---|
IgnoreError() const | void |
ToString() const | string Return a string representation of this status suitable for printing. |
Update(const Status & new_status) | void |
code() const | tensorflow::error::Code |
error_message() const | const string & |
ok() const | bool Returns true iff the status indicates success. |
operator!=(const Status & x) const | bool |
operator=(const Status & s) | void |
operator==(const Status & x) const | bool |
Public static functions | |
---|---|
OK() |
void IgnoreError() const
Status()
Create a success status.
Status( tensorflow::error::Code code, tensorflow::StringPiece msg )
Create a status with the specified error code and msg as a human-readable string containing more detailed information.
Status( const Status & s )
Copy the specified status.
string ToString() const
Return a string representation of this status suitable for printing.
Returns the string "OK"
for success.
void Update( const Status & new_status )
If ok()
, stores new_status
into *this
.
If !ok()
, preserves the current status, but may augment with additional information about new_status
.
Convenient way of keeping track of the first error encountered. Instead of: if (overall_status.ok()) overall_status = new_status
Use: overall_status.Update(new_status);
tensorflow::error::Code code() const
const string & error_message() const
bool ok() const
Returns true iff the status indicates success.
bool operator!=( const Status & x ) const
void operator=( const Status & s )
bool operator==( const Status & x ) const
Status OK()
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/class/tensorflow/status.html