1/* Copyright 2021 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 is a macro metaprogramming file for dealing with DType in a generic 17// way. 18 19// To use this file, #define the DTYPE macro and include the file. The first 20// argument provided is the TFRT enum name for the dtype, and the second is the 21// corresponding tensorflow::DataType. 22 23// Add more dtypes as necessary. 24DTYPE(I1, DT_BOOL) 25DTYPE(I8, DT_INT8) 26DTYPE(I16, DT_INT16) 27DTYPE(I32, DT_INT32) 28DTYPE(I64, DT_INT64) 29DTYPE(UI8, DT_UINT8) 30DTYPE(UI16, DT_UINT16) 31DTYPE(UI32, DT_UINT32) 32DTYPE(UI64, DT_UINT64) 33DTYPE(BF16, DT_BFLOAT16) 34DTYPE(F16, DT_HALF) 35DTYPE(F32, DT_FLOAT) 36DTYPE(F64, DT_DOUBLE) 37DTYPE(Complex64, DT_COMPLEX64) 38DTYPE(Complex128, DT_COMPLEX128) 39DTYPE(String, DT_STRING) 40DTYPE(Resource, DT_RESOURCE) 41DTYPE(Variant, DT_VARIANT) 42#undef DTYPE 43