diff options
author | Skye Wanderman-Milne <skyewm@google.com> | 2017-04-26 16:37:52 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-04-26 17:53:17 -0700 |
commit | 54b5650eb4445548eb1d0e98346e4563b3db0f10 (patch) | |
tree | 7d5506c67df6dd959fb559ab2c66dca2226ac86d /tensorflow/c/c_api.h | |
parent | c4ce79d371364a6f10a55e952db1cc718f60f2e5 (diff) |
Name enums in C API (in addition to typedefs).
SWIG will sometimes generate type references like "enum TF_DataType", which
doesn't compile if only the typedef is named.
Change: 154369467
Diffstat (limited to 'tensorflow/c/c_api.h')
-rw-r--r-- | tensorflow/c/c_api.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/c/c_api.h b/tensorflow/c/c_api.h index e2aeef0d88..ec9b01b388 100644 --- a/tensorflow/c/c_api.h +++ b/tensorflow/c/c_api.h @@ -95,7 +95,7 @@ TF_CAPI_EXPORT extern const char* TF_Version(); // -------------------------------------------------------------------------- // TF_DataType holds the type for a scalar value. E.g., one slot in a tensor. // The enum values here are identical to corresponding values in types.proto. -typedef enum { +typedef enum TF_DataType { TF_FLOAT = 1, TF_DOUBLE = 2, TF_INT32 = 3, // Int32 tensors are always in 'host' memory. @@ -127,7 +127,7 @@ TF_CAPI_EXPORT extern size_t TF_DataTypeSize(TF_DataType dt); // -------------------------------------------------------------------------- // TF_Code holds an error code. The enum values here are identical to // corresponding values in error_codes.proto. -typedef enum { +typedef enum TF_Code { TF_OK = 0, TF_CANCELLED = 1, TF_UNKNOWN = 2, @@ -629,7 +629,7 @@ TF_CAPI_EXPORT extern int TF_OperationGetControlOutputs( int max_control_outputs); // TF_AttrType describes the type of the value of an attribute on an operation. -typedef enum { +typedef enum TF_AttrType { TF_ATTR_STRING = 0, TF_ATTR_INT = 1, TF_ATTR_FLOAT = 2, |