aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/toco/model.h
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-07-16 19:09:52 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-16 19:13:36 -0700
commit1a2af489b1087eb22ec76863867e4e397e453e34 (patch)
treed2576dbbfc6f77897e59353e0844aa0c75a23033 /tensorflow/contrib/lite/toco/model.h
parentd8f3425e5b054dff01b5ece80e8c8a101c4ed816 (diff)
Support reduce_max and reduce_prod
PiperOrigin-RevId: 204846139
Diffstat (limited to 'tensorflow/contrib/lite/toco/model.h')
-rw-r--r--tensorflow/contrib/lite/toco/model.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/tensorflow/contrib/lite/toco/model.h b/tensorflow/contrib/lite/toco/model.h
index d06a30b638..37f4188cf7 100644
--- a/tensorflow/contrib/lite/toco/model.h
+++ b/tensorflow/contrib/lite/toco/model.h
@@ -85,6 +85,7 @@ enum class OperatorType : uint8 {
kBatchToSpaceND,
kPad,
kPadV2,
+ kReduceProd, // Reduction product
kStridedSlice,
kSlice,
kSqueeze,
@@ -106,10 +107,10 @@ enum class OperatorType : uint8 {
kIdentity,
kLess,
kLessEqual,
- kMax, // Reduction Max
- kMaximum, // Element-wise Maximum
- kMin, // Reduction Min
- kMinimum, // Element-wise Minimum
+ kReduceMax, // Reduction Max
+ kMaximum, // Element-wise Maximum
+ kMin, // Reduction Min
+ kMinimum, // Element-wise Minimum
kMatMul,
kMerge,
kNeg,
@@ -1229,6 +1230,19 @@ struct SubOperator : Operator {
// TensorFlow equivalent: Sum
struct TensorFlowSumOperator : Operator {
TensorFlowSumOperator() : Operator(OperatorType::kSum) {}
+ std::vector<int> axis;
+ bool keep_dims = false;
+};
+
+// Prod reduction: computes the product of all of entries across the axes.
+//
+// Inputs:
+// inputs[0]: required: the input array
+//
+// TensorFlow equivalent: Prod
+struct TensorFlowProdOperator : Operator {
+ TensorFlowProdOperator() : Operator(OperatorType::kReduceProd) {}
+ std::vector<int> axis;
bool keep_dims = false;
};
@@ -1388,16 +1402,15 @@ struct TensorFlowNotEqualOperator : Operator {
TensorFlowNotEqualOperator() : Operator(OperatorType::kNotEqual) {}
};
-// Global max reduction: computes the max of all of entries in the input array.
-// Thus the output is "0-dimensional": it consists of a single scalar value.
+// Max reduction: computes the max of all of entries across the axes.
//
// Inputs:
// inputs[0]: required: the input array
//
-// TensorFlow equivalent: Max --- except that we only support the special case
-// of global reduction across all dimensions.
+// TensorFlow equivalent: Max
struct TensorFlowMaxOperator : Operator {
- TensorFlowMaxOperator() : Operator(OperatorType::kMax) {}
+ TensorFlowMaxOperator() : Operator(OperatorType::kReduceMax) {}
+ std::vector<int> axis;
bool keep_dims = false;
};