aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/toco/model.h
diff options
context:
space:
mode:
authorGravatar RJ Ryan <rjryan@google.com>2018-06-27 18:11:03 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-27 18:13:25 -0700
commit128b69878362dcec736326d52828d2167ce291cb (patch)
tree7cc93883a8248c3ee8f799502e4d39646a31a419 /tensorflow/contrib/lite/toco/model.h
parent2b3b5054c7ceff0bc2811cfe0ebc063947801ce0 (diff)
Add complex64 support to tf.lite runtime.
PiperOrigin-RevId: 202403235
Diffstat (limited to 'tensorflow/contrib/lite/toco/model.h')
-rw-r--r--tensorflow/contrib/lite/toco/model.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/tensorflow/contrib/lite/toco/model.h b/tensorflow/contrib/lite/toco/model.h
index aa05a9bd0e..abe0bf3c54 100644
--- a/tensorflow/contrib/lite/toco/model.h
+++ b/tensorflow/contrib/lite/toco/model.h
@@ -15,6 +15,7 @@ limitations under the License.
#ifndef TENSORFLOW_CONTRIB_LITE_TOCO_MODEL_H_
#define TENSORFLOW_CONTRIB_LITE_TOCO_MODEL_H_
+#include <complex>
#include <functional>
#include <initializer_list>
#include <memory>
@@ -161,15 +162,16 @@ enum class AxesOrder {
// The type of the scalars in an array.
// Note that the type does not by itself tell whether the values in the array
-// are real (are literally interpreted as real numbers) or quantized (only
-// acquire a meaning as real numbers in conjunction with QuantizationParams).
+// are non-quantized (can be accessed directly) or quantized (must be
+// interpreted in conjunction with QuantizationParams).
//
// In practice though:
-// float values are always real
+// float values are never quantized
// uint8 values are always quantized
-// int32 values are either real or quantized (depending on whether
+// int32 values are sometimes quantized (depending on whether
// QuantizationParams are present).
-// other types are unused at the moment.
+// complex values are never quantized
+// other types are never quantized at the moment.
//
// kNone means that we don't know the data type yet, or that we don't care
// because we'll be dropping the array anyway (e.g. some exotic array types
@@ -187,7 +189,8 @@ enum class ArrayDataType : uint8 {
kUint32,
kInt64,
kUint64, // 10
- kString
+ kString,
+ kComplex64,
};
// Compile-time logic to map ArrayDataType to the corresponding C++ scalar type
@@ -241,6 +244,10 @@ template <>
struct DataTypeImpl<ArrayDataType::kString> {
typedef string Type;
};
+template <>
+struct DataTypeImpl<ArrayDataType::kComplex64> {
+ typedef std::complex<float> Type;
+};
template <ArrayDataType A>
using DataType = typename DataTypeImpl<A>::Type;