aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-05-11 19:38:48 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-05-11 19:41:29 -0700
commit52e2698ac969a0f82c6ce901f80f04818ca8ac4e (patch)
tree5b89fa879c61cac2f3b64d5edbf405ad616edde5 /tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc
parent84b5938aaee991d6909e16e56c66bf88e8843fbb (diff)
Making GetInput from kernel_util.h return a pointer to const data.
PiperOrigin-RevId: 196340200
Diffstat (limited to 'tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc')
-rw-r--r--tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc b/tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc
index 6c770e7f71..d3be36993c 100644
--- a/tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc
+++ b/tensorflow/contrib/lite/kernels/embedding_lookup_sparse.cc
@@ -81,19 +81,19 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 5);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
- TfLiteTensor* ids = GetInput(context, node, 0);
+ const TfLiteTensor* ids = GetInput(context, node, 0);
TF_LITE_ENSURE_EQ(context, NumDimensions(ids), 1);
TF_LITE_ENSURE_EQ(context, ids->type, kTfLiteInt32);
- TfLiteTensor* indices = GetInput(context, node, 1);
+ const TfLiteTensor* indices = GetInput(context, node, 1);
TF_LITE_ENSURE_EQ(context, NumDimensions(indices), 2);
TF_LITE_ENSURE_EQ(context, indices->type, kTfLiteInt32);
- TfLiteTensor* shape = GetInput(context, node, 2);
+ const TfLiteTensor* shape = GetInput(context, node, 2);
TF_LITE_ENSURE_EQ(context, NumDimensions(shape), 1);
TF_LITE_ENSURE_EQ(context, shape->type, kTfLiteInt32);
- TfLiteTensor* weights = GetInput(context, node, 3);
+ const TfLiteTensor* weights = GetInput(context, node, 3);
TF_LITE_ENSURE_EQ(context, NumDimensions(weights), 1);
TF_LITE_ENSURE_EQ(context, weights->type, kTfLiteFloat32);
@@ -102,7 +102,7 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, SizeOfDimension(indices, 0),
SizeOfDimension(weights, 0));
- TfLiteTensor* value = GetInput(context, node, 4);
+ const TfLiteTensor* value = GetInput(context, node, 4);
TF_LITE_ENSURE(context, NumDimensions(value) >= 2);
// Mark the output as a dynamic tensor.
@@ -139,11 +139,11 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* params =
reinterpret_cast<TfLiteEmbeddingLookupSparseParams*>(node->builtin_data);
TfLiteTensor* output = GetOutput(context, node, 0);
- TfLiteTensor* ids = GetInput(context, node, 0);
- TfLiteTensor* indices = GetInput(context, node, 1);
- TfLiteTensor* dense_shape = GetInput(context, node, 2);
- TfLiteTensor* weights = GetInput(context, node, 3);
- TfLiteTensor* value = GetInput(context, node, 4);
+ const TfLiteTensor* ids = GetInput(context, node, 0);
+ const TfLiteTensor* indices = GetInput(context, node, 1);
+ const TfLiteTensor* dense_shape = GetInput(context, node, 2);
+ const TfLiteTensor* weights = GetInput(context, node, 3);
+ const TfLiteTensor* value = GetInput(context, node, 4);
const int lookup_rank = SizeOfDimension(indices, 1);
const int embedding_rank = NumDimensions(value);