| 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. |
| 2 | |
| 3 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | you may not use this file except in compliance with the License. |
| 5 | You may obtain a copy of the License at |
| 6 | |
| 7 | http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | |
| 9 | Unless required by applicable law or agreed to in writing, software |
| 10 | distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | See the License for the specific language governing permissions and |
| 13 | limitations under the License. |
| 14 | ==============================================================================*/ |
| 15 | |
| 16 | // This file contains descriptions of the various TensorFlow types. This is |
| 17 | // used as a central place for enumerating the different types. |
| 18 | |
| 19 | #ifdef HANDLE_TF_TYPE |
| 20 | |
| 21 | // class, enumerant, name |
| 22 | HANDLE_TF_TYPE(Qint8, QINT8, "qint8") |
| 23 | HANDLE_TF_TYPE(Qint16, QINT16, "qint16") |
| 24 | HANDLE_TF_TYPE(Qint32, QINT32, "qint32") |
| 25 | HANDLE_TF_TYPE(Quint8, QUINT8, "quint8") |
| 26 | HANDLE_TF_TYPE(Quint16, QUINT16, "quint16") |
| 27 | HANDLE_TF_TYPE(String, STRING, "string") |
| 28 | |
| 29 | #ifndef HANDLE_CUSTOM_TF_TYPE |
| 30 | #define HANDLE_CUSTOM_TF_TYPE(class, enumerant, name) \ |
| 31 | HANDLE_TF_TYPE(class, enumerant, name) |
| 32 | #endif |
| 33 | HANDLE_CUSTOM_TF_TYPE(Resource, RESOURCE, "resource") |
| 34 | HANDLE_CUSTOM_TF_TYPE(Variant, VARIANT, "variant") |
| 35 | #undef HANDLE_CUSTOM_TF_TYPE |
| 36 | |
| 37 | // All ref types are listed below this line and FloatRef is the first ref type. |
| 38 | // This helps in easily differentiating ref and non-ref types, and converting |
| 39 | // a type to/from ref types. |
| 40 | |
| 41 | #ifndef HANDLE_TF_REF_TYPE |
| 42 | #define HANDLE_TF_REF_TYPE(class, enumerant, name) \ |
| 43 | HANDLE_TF_TYPE(class, enumerant, name) |
| 44 | #endif |
| 45 | HANDLE_TF_REF_TYPE(FloatRef, FLOAT_REF, "f32ref") |
| 46 | HANDLE_TF_REF_TYPE(DoubleRef, DOUBLE_REF, "f64ref") |
| 47 | HANDLE_TF_REF_TYPE(Uint8Ref, UINT8_REF, "uint8ref") |
| 48 | HANDLE_TF_REF_TYPE(Int8Ref, INT8_REF, "int8ref") |
| 49 | HANDLE_TF_REF_TYPE(Uint16Ref, UINT16_REF, "uint16ref") |
| 50 | HANDLE_TF_REF_TYPE(Int16Ref, INT16_REF, "int16ref") |
| 51 | HANDLE_TF_REF_TYPE(Uint32Ref, UINT32_REF, "uint32ref") |
| 52 | HANDLE_TF_REF_TYPE(Int32Ref, INT32_REF, "int32ref") |
| 53 | HANDLE_TF_REF_TYPE(Uint64Ref, UINT64_REF, "uint64ref") |
| 54 | HANDLE_TF_REF_TYPE(Int64Ref, INT64_REF, "int64ref") |
| 55 | HANDLE_TF_REF_TYPE(StringRef, STRING_REF, "stringref") |
| 56 | HANDLE_TF_REF_TYPE(BoolRef, BOOL_REF, "boolref") |
| 57 | HANDLE_TF_REF_TYPE(Quint8Ref, QUINT8_REF, "quint8ref") |
| 58 | HANDLE_TF_REF_TYPE(Qint8Ref, QINT8_REF, "qint8ref") |
| 59 | HANDLE_TF_REF_TYPE(Quint16Ref, QUINT16_REF, "quint16ref") |
| 60 | HANDLE_TF_REF_TYPE(Qint16Ref, QINT16_REF, "qint16ref") |
| 61 | HANDLE_TF_REF_TYPE(Qint32Ref, QINT32_REF, "qint32ref") |
| 62 | HANDLE_TF_REF_TYPE(Bfloat16Ref, BFLOAT16_REF, "bfloat16ref") |
| 63 | HANDLE_TF_REF_TYPE(Complex64Ref, COMPLEX64_REF, "complex64ref") |
| 64 | HANDLE_TF_REF_TYPE(Complex128Ref, COMPLEX128_REF, "complex128ref") |
| 65 | HANDLE_TF_REF_TYPE(HalfRef, HALF_REF, "halfref") |
| 66 | HANDLE_TF_REF_TYPE(ResourceRef, RESOURCE_REF, "resourceref") |
| 67 | |
| 68 | #ifndef HANDLE_LAST_TF_TYPE |
| 69 | #define HANDLE_LAST_TF_TYPE(class, enumerant, name) \ |
| 70 | HANDLE_TF_REF_TYPE(class, enumerant, name) |
| 71 | #endif |
| 72 | HANDLE_LAST_TF_TYPE(VariantRef, VARIANT_REF, "variantref") |
| 73 | #undef HANDLE_LAST_TF_TYPE |
| 74 | |
| 75 | #undef HANDLE_TF_REF_TYPE |
| 76 | #undef HANDLE_TF_TYPE |
| 77 | #endif |