summaryrefslogtreecommitdiff
path: root/candle-examples/examples/segment-anything/model_mask_decoder.rs
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2023-09-08 08:50:27 +0100
committerGitHub <noreply@github.com>2023-09-08 08:50:27 +0100
commit989a4807b151f08c651b5027cc1b547a59adf966 (patch)
tree8bce93e5da15e7961505f579ec6a4a882287283b /candle-examples/examples/segment-anything/model_mask_decoder.rs
parent0e250aee4fcff8991c086ba0606a90db92b4e488 (diff)
downloadcandle-989a4807b151f08c651b5027cc1b547a59adf966.tar.gz
candle-989a4807b151f08c651b5027cc1b547a59adf966.tar.bz2
candle-989a4807b151f08c651b5027cc1b547a59adf966.zip
Use shape with holes. (#771)
Diffstat (limited to 'candle-examples/examples/segment-anything/model_mask_decoder.rs')
-rw-r--r--candle-examples/examples/segment-anything/model_mask_decoder.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/candle-examples/examples/segment-anything/model_mask_decoder.rs b/candle-examples/examples/segment-anything/model_mask_decoder.rs
index 1ef46eeb..acbfeeea 100644
--- a/candle-examples/examples/segment-anything/model_mask_decoder.rs
+++ b/candle-examples/examples/segment-anything/model_mask_decoder.rs
@@ -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)?;