feat: update workspace paths and enhance gitignore
- 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
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
use burn_backend::{TensorMetadata, ops::FloatTensorOps};
|
||||
use burn_tch::{LibTorch, LibTorchDevice};
|
||||
|
||||
fn main() {
|
||||
type B = LibTorch<f32>;
|
||||
let device = LibTorchDevice::Cpu;
|
||||
|
||||
// Creation of two tensors, the first with explicit values and the second one with ones, with the same shape as the first
|
||||
let tensor_1 = B::float_from_data([[2f32, 3.], [4., 5.]].into(), &device);
|
||||
let tensor_2 = B::float_ones(tensor_1.shape(), &device, tensor_1.dtype().into());
|
||||
|
||||
// Print the element-wise addition of the two tensors.
|
||||
println!("{}", B::float_add(tensor_1, tensor_2));
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
use burn_backend::{TensorMetadata, ops::FloatTensorOps};
|
||||
use burn_tch::{LibTorch, LibTorchDevice};
|
||||
|
||||
fn main() {
|
||||
assert!(
|
||||
tch::utils::has_cuda(),
|
||||
"Could not detect valid CUDA configuration"
|
||||
);
|
||||
|
||||
type B = LibTorch<f32>;
|
||||
let device = LibTorchDevice::Cuda(0);
|
||||
|
||||
// Creation of two tensors, the first with explicit values and the second one with ones, with the same shape as the first
|
||||
let tensor_1 = B::float_from_data([[2f32, 3.], [4., 5.]].into(), &device);
|
||||
let tensor_2 = B::float_ones(tensor_1.shape(), &device, tensor_1.dtype().into());
|
||||
|
||||
// Print the element-wise addition of the two tensors.
|
||||
println!("{}", B::float_add(tensor_1, tensor_2));
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
use burn_backend::{TensorMetadata, ops::FloatTensorOps};
|
||||
use burn_tch::{LibTorch, LibTorchDevice};
|
||||
|
||||
fn main() {
|
||||
assert!(tch::utils::has_mps(), "Could not detect MPS");
|
||||
|
||||
type B = LibTorch<f32>;
|
||||
let device = LibTorchDevice::Mps;
|
||||
|
||||
// Creation of two tensors, the first with explicit values and the second one with ones, with the same shape as the first
|
||||
let tensor_1 = B::float_from_data([[2f32, 3.], [4., 5.]].into(), &device);
|
||||
let tensor_2 = B::float_ones(tensor_1.shape(), &device, tensor_1.dtype().into());
|
||||
|
||||
// Print the element-wise addition of the two tensors.
|
||||
println!("{}", B::float_add(tensor_1, tensor_2));
|
||||
}
|
||||
Reference in New Issue
Block a user