mirror of
https://github.com/huggingface/candle.git
synced 2025-06-18 11:37:11 +00:00
Automatic mask generation (#779)
* A few more contiguous fixes for cuda. * Mask generation. * Generic bbox. * Generate all the masks.
This commit is contained in:
@ -219,7 +219,7 @@ impl MaskDecoder {
|
||||
let h = mlp.forward(&mask_tokens_out.i((.., i))?)?;
|
||||
hyper_in_list.push(h)
|
||||
}
|
||||
let hyper_in = Tensor::stack(hyper_in_list.as_slice(), 1)?;
|
||||
let hyper_in = Tensor::stack(hyper_in_list.as_slice(), 1)?.contiguous()?;
|
||||
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, (), h, w))?;
|
||||
|
Reference in New Issue
Block a user