From 0a65decbb772e3f5f431a94ec0b8110795b8a1df Mon Sep 17 00:00:00 2001 From: Xin Li Date: Wed, 11 Jan 2017 05:00:34 +0800 Subject: [PATCH] Handle empty tuple (#95) --- include/nnvm/tuple.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/nnvm/tuple.h b/include/nnvm/tuple.h index 41e74c8f8fe4..3de9a910ee6f 100644 --- a/include/nnvm/tuple.h +++ b/include/nnvm/tuple.h @@ -233,6 +233,15 @@ class Tuple { return is; } } + // Handle empty tuple + while (isspace(is.peek())) { + is.get(); + } + if (is.peek() == ')') { + is.get(); + return is; + } + // Handle non-empty tuple ValueType idx; std::vector tmp; while (is >> idx) {