W3cubDocs

/TensorFlow C++

tensorflow::Status

#include <status.h>

Denotes success or failure of a call in Tensorflow.

Summary

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
If ok(), stores new_status into *this.
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()

Public functions

IgnoreError

void IgnoreError() const 

Status

Status()

Create a success status.

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

 Status(
  const Status & s
)

Copy the specified status.

ToString

string ToString() const 

Return a string representation of this status suitable for printing.

Returns the string "OK" for success.

Update

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);

code

tensorflow::error::Code code() const 

error_message

const string & error_message() const 

ok

bool ok() const 

Returns true iff the status indicates success.

operator!=

bool operator!=(
  const Status & x
) const 

operator=

void operator=(
  const Status & s
)

operator==

bool operator==(
  const Status & x
) const 

Public static functions

OK

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