mirror of
https://github.com/huggingface/candle.git
synced 2025-06-17 02:58:50 +00:00
Simple pad support. (#336)
* Simple pad support. * Fix the tensor indexing when padding.
This commit is contained in:
@ -57,7 +57,7 @@ impl Timesteps {
|
||||
Tensor::cat(&[&sin, &cos], D::Minus1)?
|
||||
};
|
||||
if self.num_channels % 2 == 1 {
|
||||
crate::utils::pad(&emb) // ([0, 1, 0, 0], 'constant', None)
|
||||
emb.pad_with_zeros(D::Minus2, 0, 1)
|
||||
} else {
|
||||
Ok(emb)
|
||||
}
|
||||
|
Reference in New Issue
Block a user