From f096c06ff9e928d88e2d9352ee19bf07c1ab1ebf Mon Sep 17 00:00:00 2001 From: Zhi <5145158+zhiics@users.noreply.github.com> Date: Tue, 31 Dec 2019 22:36:19 -0800 Subject: [PATCH] make adt tag signed (#4605) --- include/tvm/runtime/container.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/tvm/runtime/container.h b/include/tvm/runtime/container.h index 4dc07f4a3a04..92d3e7149463 100644 --- a/include/tvm/runtime/container.h +++ b/include/tvm/runtime/container.h @@ -164,7 +164,7 @@ class InplaceArrayBase { class ADTObj : public Object, public InplaceArrayBase { public: /*! \brief The tag representing the constructor used. */ - uint32_t tag; + int32_t tag; /*! \brief Number of fields in the ADT object. */ uint32_t size; // The fields of the structure follows directly in memory. @@ -211,7 +211,7 @@ class ADT : public ObjectRef { * \param fields The fields of the ADT object. * \return The constructed ADT object reference. */ - ADT(uint32_t tag, std::vector fields) + ADT(int32_t tag, std::vector fields) : ADT(tag, fields.begin(), fields.end()){}; /*! @@ -222,7 +222,7 @@ class ADT : public ObjectRef { * \return The constructed ADT object reference. */ template - ADT(uint32_t tag, Iterator begin, Iterator end) { + ADT(int32_t tag, Iterator begin, Iterator end) { size_t num_elems = std::distance(begin, end); auto ptr = make_inplace_array_object(num_elems); ptr->tag = tag; @@ -236,7 +236,7 @@ class ADT : public ObjectRef { * \param init The initializer list of fields. * \return The constructed ADT object reference. */ - ADT(uint32_t tag, std::initializer_list init) + ADT(int32_t tag, std::initializer_list init) : ADT(tag, init.begin(), init.end()){}; /*! @@ -252,7 +252,7 @@ class ADT : public ObjectRef { /*! * \brief Return the ADT tag. */ - size_t tag() const { return operator->()->tag; } + int32_t tag() const { return operator->()->tag; } /*! * \brief Return the number of fields.