1/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7    http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations 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
22HANDLE_TF_TYPE(Qint8, QINT8, "qint8")
23HANDLE_TF_TYPE(Qint16, QINT16, "qint16")
24HANDLE_TF_TYPE(Qint32, QINT32, "qint32")
25HANDLE_TF_TYPE(Quint8, QUINT8, "quint8")
26HANDLE_TF_TYPE(Quint16, QUINT16, "quint16")
27HANDLE_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
33HANDLE_CUSTOM_TF_TYPE(Resource, RESOURCE, "resource")
34HANDLE_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
45HANDLE_TF_REF_TYPE(FloatRef, FLOAT_REF, "f32ref")
46HANDLE_TF_REF_TYPE(DoubleRef, DOUBLE_REF, "f64ref")
47HANDLE_TF_REF_TYPE(Uint8Ref, UINT8_REF, "uint8ref")
48HANDLE_TF_REF_TYPE(Int8Ref, INT8_REF, "int8ref")
49HANDLE_TF_REF_TYPE(Uint16Ref, UINT16_REF, "uint16ref")
50HANDLE_TF_REF_TYPE(Int16Ref, INT16_REF, "int16ref")
51HANDLE_TF_REF_TYPE(Uint32Ref, UINT32_REF, "uint32ref")
52HANDLE_TF_REF_TYPE(Int32Ref, INT32_REF, "int32ref")
53HANDLE_TF_REF_TYPE(Uint64Ref, UINT64_REF, "uint64ref")
54HANDLE_TF_REF_TYPE(Int64Ref, INT64_REF, "int64ref")
55HANDLE_TF_REF_TYPE(StringRef, STRING_REF, "stringref")
56HANDLE_TF_REF_TYPE(BoolRef, BOOL_REF, "boolref")
57HANDLE_TF_REF_TYPE(Quint8Ref, QUINT8_REF, "quint8ref")
58HANDLE_TF_REF_TYPE(Qint8Ref, QINT8_REF, "qint8ref")
59HANDLE_TF_REF_TYPE(Quint16Ref, QUINT16_REF, "quint16ref")
60HANDLE_TF_REF_TYPE(Qint16Ref, QINT16_REF, "qint16ref")
61HANDLE_TF_REF_TYPE(Qint32Ref, QINT32_REF, "qint32ref")
62HANDLE_TF_REF_TYPE(Bfloat16Ref, BFLOAT16_REF, "bfloat16ref")
63HANDLE_TF_REF_TYPE(Complex64Ref, COMPLEX64_REF, "complex64ref")
64HANDLE_TF_REF_TYPE(Complex128Ref, COMPLEX128_REF, "complex128ref")
65HANDLE_TF_REF_TYPE(HalfRef, HALF_REF, "halfref")
66HANDLE_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
72HANDLE_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
78