masahi commented on code in PR #15419:
URL: https://github.com/apache/tvm/pull/15419#discussion_r1283628047
##########
src/runtime/vm/bytecode.cc:
##########
@@ -252,13 +252,17 @@ Instruction::~Instruction() {
case Opcode::GetTag:
case Opcode::Goto:
case Opcode::LoadConsti:
- case Opcode::AllocStorage:
case Opcode::ShapeOf:
case Opcode::ReshapeTensor:
case Opcode::DeviceCopy:
case Opcode::Fatal:
case Opcode::KillRegister:
return;
+ case Opcode::AllocStorage:
+ if (this->alloc_storage.ndim > 0) {
Review Comment:
I'd prefer more direct
`this->alloc_storage.shape != nullptr`
since `this->alloc_storage.ndim > 0` is assuming the logic implemented
elsewhere that the shape is non-null only when `this->alloc_storage.ndim > 0`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]