Like SubView, SubTensor/SubTensorInsertOp are allowed to have rank-reducing/expanding semantics. In the case of SubTensorInsertOp , the rank of offsets/sizes/strides should be the rank of the destination tensor.
Also, add a builder flavor for SubTensorOp to return a rank-reduced tensor.
nit: I think you can do SmallVector<int64_t, 4> staticOffsetsVector(rank, ShapedType::kDynamicStrideOrOffset);