@@ -256,25 +256,11 @@ bool DensePackRel(const Array<Type>& types, int num_inputs, const Attrs& attrs,
256
256
const DenseAttrs* param = attrs.as <DenseAttrs>();
257
257
ICHECK (param != nullptr );
258
258
259
- // Sicne the topi impl only supports 2D data, we want to enable the following check.
260
- // However, this function can be called when layout transform on inputs has not been
261
- // inserted yet during AlterOpLayout. In such cases, the input data can be packed,
262
- // i.e. data->shape.size() == 3.
263
- // ICHECK_EQ(data->shape.size(), 2)
259
+ ICHECK_EQ (data->shape .size (), 2 ) << " Only 2D data is supported" ;
260
+ ICHECK_EQ (weight->shape .size (), 3 ) << " Weight is not packed" ;
264
261
265
262
Array<tvm::PrimExpr> oshape = data->shape ;
266
- if (weight->shape .size () == 3 ) {
267
- // The packed case, after AlterOpLayout is complete
268
- ICHECK_EQ (data->shape .size (), 2 ) << " Layout transform has been applied to weight but not to "
269
- " data. Only 2D data is supported." ;
270
- oshape.Set ((oshape.size () - 1 ), weight->shape [0 ] * weight->shape [2 ]);
271
- } else {
272
- // This code path hits when contrib_dense_pack is called but before layout transform
273
- // on inputs are inserted.
274
- ICHECK_EQ (weight->shape .size (), 2 )
275
- << " weight shape before layout transform is applied should be 2D." ;
276
- oshape.Set ((oshape.size () - 1 ), weight->shape [0 ] * weight->shape [1 ]);
277
- }
263
+ oshape.Set (1 , weight->shape [0 ] * weight->shape [2 ]);
278
264
279
265
DataType out_dtype = param->out_dtype ;
280
266
if (out_dtype.bits () == 0 ) {
0 commit comments