- Updated stablediffusion crate path from "../stable-diffusion-burn" to "./crates/stable-diffusion-burn" for proper workspace resolution - Enhanced .gitignore to include generated model files (.mpk, .pt, .bin, .safetensors, .ckpt) and user_data directory - Added Cargo.lock to gitignore with appropriate comment - Reorganized IDE files section in gitignore for better clarity - Added newline at end of file for proper formatting
22 lines
793 B
Rust
22 lines
793 B
Rust
use super::*;
|
|
use burn_tensor::Tolerance;
|
|
use burn_tensor::{Distribution, Int, Tensor};
|
|
|
|
#[test]
|
|
fn select_should_work_with_multiple_workgroups() {
|
|
let tensor =
|
|
Tensor::<TestBackend, 2>::random([6, 256], Distribution::Default, &Default::default());
|
|
let indices = Tensor::<TestBackend, 1, Int>::arange(0..100, &Default::default());
|
|
let tensor_ref =
|
|
Tensor::<ReferenceBackend, 2>::from_data(tensor.to_data(), &Default::default());
|
|
let indices_ref =
|
|
Tensor::<ReferenceBackend, 1, Int>::from_data(indices.to_data(), &Default::default());
|
|
|
|
let actual = tensor.select(1, indices);
|
|
let expected = tensor_ref.select(1, indices_ref);
|
|
|
|
expected
|
|
.into_data()
|
|
.assert_approx_eq::<FloatElem>(&actual.into_data(), Tolerance::default());
|
|
}
|