Stay organized with collections
Save and categorize content based on your preferences.
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 static functions
|
OK()
|
|
Public functions
IgnoreError
void IgnoreError() const
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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-04-20 UTC.
[null,null,["Last updated 2020-04-20 UTC."],[],[],null,["# tensorflow::Status Class Reference\n\ntensorflow::Status\n==================\n\n`#include \u003cstatus.h\u003e`\n\nDenotes success or failure of a call in Tensorflow.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Status](#classtensorflow_1_1_status_1a71ab5e0bcbba7dce4f36a9655244ba28)`()` Create a success status. ||\n| [Status](#classtensorflow_1_1_status_1ae5db42baf704c6cfd9b2218258e2ecb0)`(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. ||\n| [Status](#classtensorflow_1_1_status_1a1601d7da5d517e2292c4550c4dabd4f6)`(const `[Status](/versions/r1.15/api_docs/cc/class/tensorflow/status#classtensorflow_1_1_status)` & s)` Copy the specified status. ||\n\n| ### Public functions ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [IgnoreError](#classtensorflow_1_1_status_1ab716b30a0414df51c44293d437bcb6d1)`() const ` | `void` |\n| [ToString](#classtensorflow_1_1_status_1ae9ec82110337db2d5f7fccbf074c576f)`() const ` | `string` Return a string representation of this status suitable for printing. |\n| [Update](#classtensorflow_1_1_status_1a167c59a5e6ec8bb8b5fa480a225d0fa1)`(const `[Status](/versions/r1.15/api_docs/cc/class/tensorflow/status#classtensorflow_1_1_status)` & new_status)` | `void` If [ok()](/versions/r1.15/api_docs/cc/class/tensorflow/status#classtensorflow_1_1_status_1a6c078283eadeeb5ed337f36582138c00), stores `new_status` into `*this`. |\n| [code](#classtensorflow_1_1_status_1ae7e45879c3f69b952877461a02950ce9)`() const ` | `tensorflow::error::Code` |\n| [error_message](#classtensorflow_1_1_status_1ab354605de9047f27583cc93d9b256aca)`() const ` | `const string &` |\n| [ok](#classtensorflow_1_1_status_1a6c078283eadeeb5ed337f36582138c00)`() const ` | `bool` Returns true iff the status indicates success. |\n| [operator!=](#classtensorflow_1_1_status_1a60ddc141060b51174bdd78c65c933a43)`(const `[Status](/versions/r1.15/api_docs/cc/class/tensorflow/status#classtensorflow_1_1_status)` & x) const ` | `bool` |\n| [operator=](#classtensorflow_1_1_status_1a0dda7e9456d71fb05365b62136526a94)`(const `[Status](/versions/r1.15/api_docs/cc/class/tensorflow/status#classtensorflow_1_1_status)` & s)` | `void` |\n| [operator==](#classtensorflow_1_1_status_1aea3db351a06f796f13ab9ca483d53f73)`(const `[Status](/versions/r1.15/api_docs/cc/class/tensorflow/status#classtensorflow_1_1_status)` & x) const ` | `bool` |\n\n| ### Public static functions ||\n|--------------------------------------------------------------------------|------------------------------------------------------------------------------------------|\n| [OK](#classtensorflow_1_1_status_1a2c9dab72c1556a7a88706947dff45944)`()` | [Status](/versions/r1.15/api_docs/cc/class/tensorflow/status#classtensorflow_1_1_status) |\n\nPublic functions\n----------------\n\n### IgnoreError\n\n```gdscript\nvoid IgnoreError() const \n``` \n\n### Status\n\n```text\n Status()\n``` \nCreate a success status. \n\n### Status\n\n```text\n Status(\n tensorflow::error::Code code,\n tensorflow::StringPiece msg\n)\n``` \nCreate a status with the specified error code and msg as a human-readable string containing more detailed information. \n\n### Status\n\n```gdscript\n Status(\n const Status & s\n)\n``` \nCopy the specified status. \n\n### ToString\n\n```gdscript\nstring ToString() const \n``` \nReturn a string representation of this status suitable for printing.\n\nReturns the string `\"OK\"` for success. \n\n### Update\n\n```gdscript\nvoid Update(\n const Status & new_status\n)\n``` \nIf [ok()](/versions/r1.15/api_docs/cc/class/tensorflow/status#classtensorflow_1_1_status_1a6c078283eadeeb5ed337f36582138c00), stores `new_status` into `*this`.\n\nIf `!ok()`, preserves the current status, but may augment with additional information about `new_status`.\n\nConvenient 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);` \n\n### code\n\n```gdscript\ntensorflow::error::Code code() const \n``` \n\n### error_message\n\n```gdscript\nconst string & error_message() const \n``` \n\n### ok\n\n```gdscript\nbool ok() const \n``` \nReturns true iff the status indicates success. \n\n### operator!=\n\n```gdscript\nbool operator!=(\n const Status & x\n) const \n``` \n\n### operator=\n\n```gdscript\nvoid operator=(\n const Status & s\n)\n``` \n\n### operator==\n\n```gdscript\nbool operator==(\n const Status & x\n) const \n``` \n\nPublic static functions\n-----------------------\n\n### OK\n\n```text\nStatus OK()\n```"]]