This is my c++ code.I know it will be wrong to write this way. The memory created will be 0x0x0x0x0xi8.
weightsShape
is a dynamic dimension obtained through memref.dim
.I want to be able to alloc memref<?x?x?x?xi8> memory.But I don’t know how to get the right memrefType,the first argument to MemRef::get is always an ArrayRef.I don’t know how to solve this problem.If anyone can help me, I would be grateful.Thanks!
MemRefType weightsMatType = MemRefType::get({0, 0, 0, 0}, rewriter.getI8Type());
Value weightsMat = rewriter.create<memref::AllocOp>(loc, weightsMatType, weightsShape);