mirror of
https://github.com/huggingface/candle.git
synced 2025-06-17 11:08:52 +00:00
More general broadcast setup.
This commit is contained in:
@ -144,7 +144,7 @@ fn broadcast() -> Result<()> {
|
||||
let data = &[3f32, 1., 4.];
|
||||
let tensor = Tensor::new(data, &Device::Cpu)?;
|
||||
assert_eq!(
|
||||
tensor.broadcast((3, 1))?.to_vec3::<f32>()?,
|
||||
tensor.broadcast_left((3, 1))?.to_vec3::<f32>()?,
|
||||
&[[[3.0, 1.0, 4.0]], [[3.0, 1.0, 4.0]], [[3.0, 1.0, 4.0]]]
|
||||
);
|
||||
Ok(())
|
||||
|
Reference in New Issue
Block a user