Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
wweic committed Nov 16, 2019
1 parent f23de02 commit 0a2c0cb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/tvm/runtime/container.h
Expand Up @@ -44,7 +44,7 @@ class ADTObj : public Object {
* \param idx The index of the element.
* \return The ObjectRef at the index.
*/
ObjectRef operator [](size_t idx) const;
ObjectRef operator[](size_t idx) const;

void* AddressOf(int i) const;

Expand Down
3 changes: 2 additions & 1 deletion include/tvm/runtime/memory.h
Expand Up @@ -77,8 +77,9 @@ class ObjAllocatorBase {

/*!
* \tparam T The type to be allocated.
* \tparam ElemType The type to array element.
* \tparam Args The constructor signature.
* \param extra The size of extra space.
* \param num_elems The number of array elements.
* \param args The arguments.
*/
template<typename T, typename ElemType, typename... Args>
Expand Down
4 changes: 1 addition & 3 deletions src/runtime/container.cc
Expand Up @@ -29,7 +29,7 @@
namespace tvm {
namespace runtime {

ObjectRef ADTObj::operator [](size_t idx) const {
ObjectRef ADTObj::operator[](size_t idx) const {
if (idx > this->size_) {
LOG(FATAL) << "Index out of bound at " << idx << " bound is " << this->size_ << "\n";
}
Expand All @@ -43,8 +43,6 @@ void* ADTObj::AddressOf(int i) const {
}

ADTObj::~ADTObj() {
ADTObj* self = const_cast<ADTObj*>(this);
Object* parent = static_cast<Object*>(self);
for (size_t i = 0; i < size_; ++i) {
ObjectRef* fp = reinterpret_cast<ObjectRef*>(AddressOf(i));
fp->ObjectRef::~ObjectRef();
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/vm/object.cc
Expand Up @@ -80,7 +80,7 @@ TVM_REGISTER_GLOBAL("_vmobj.GetADTFields")
const auto* cell = obj.as<ADTObj>();
CHECK(cell != nullptr);
CHECK_LT(idx, cell->size_);
*rv = cell->operator [](idx);
*rv = (*cell)[idx];
});

TVM_REGISTER_GLOBAL("_vmobj.Tensor")
Expand Down

0 comments on commit 0a2c0cb

Please sign in to comment.