Use shape with holes. (#771)

This commit is contained in:
Laurent Mazare
2023-09-08 08:50:27 +01:00
committed by GitHub
parent 0e250aee4f
commit 989a4807b1
3 changed files with 7 additions and 7 deletions

View File

@ -214,7 +214,7 @@ impl MaskDecoder {
let hyper_in = Tensor::stack(hyper_in_list.as_slice(), 1)?;
let (b, c, h, w) = upscaled_embedding.dims4()?;
let masks = hyper_in.matmul(&upscaled_embedding.reshape((b, c, h * w))?)?;
let masks = masks.reshape((b, masks.elem_count() / b / h / w, h, w))?;
let masks = masks.reshape((b, (), h, w))?;
// Generate mask quality predictions.
let iou_pred = self.iou_prediction_head.forward(&iou_token_out)?;