mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 02:38:10 +00:00
Simplify usage of the pool functions. (#662)
* Simplify usage of the pool functions. * Small tweak. * Attempt at using apply to simplify the convnet definition.
This commit is contained in:
@ -198,15 +198,15 @@ impl Module for Sppf {
|
||||
let xs2 = xs
|
||||
.pad_with_zeros(2, self.k / 2, self.k / 2)?
|
||||
.pad_with_zeros(3, self.k / 2, self.k / 2)?
|
||||
.max_pool2d((self.k, self.k), (1, 1))?;
|
||||
.max_pool2d_with_stride(self.k, 1)?;
|
||||
let xs3 = xs2
|
||||
.pad_with_zeros(2, self.k / 2, self.k / 2)?
|
||||
.pad_with_zeros(3, self.k / 2, self.k / 2)?
|
||||
.max_pool2d((self.k, self.k), (1, 1))?;
|
||||
.max_pool2d_with_stride(self.k, 1)?;
|
||||
let xs4 = xs3
|
||||
.pad_with_zeros(2, self.k / 2, self.k / 2)?
|
||||
.pad_with_zeros(3, self.k / 2, self.k / 2)?
|
||||
.max_pool2d((self.k, self.k), (1, 1))?;
|
||||
.max_pool2d_with_stride(self.k, 1)?;
|
||||
self.cv2.forward(&Tensor::cat(&[&xs, &xs2, &xs3, &xs4], 1)?)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user