html body { margin-top: 50px !important; } #top_form { position: fixed; top:0; left:0; width: 100%; margin:0; z-index: 2100000000; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; border-bottom:1px solid #151515; background:#FFC8C8; height:45px; line-height:45px; } #top_form input[name=url] { width: 550px; height: 20px; padding: 5px; font: 13px "Helvetica Neue",Helvetica,Arial,sans-serif; border: 0px none; background: none repeat scroll 0% 0% #FFF; }
nav]:order-last [&_footer]:max-lg:px-6 [&_section]:max-lg:px-6">
Burn Ride

Begin Your Journey

  1. Burn Book
  2. Documentation
01

Install Rust

The first step is to install Rust. Refer to the Rust book's installation page.

Down arrow
02

Create a Rust Application

  1. Open your preferred terminal or command prompt.
  2. Use Cargo, Rust's package manager, to create a new Burn application in a specific directory.
  3. Change your current directory to the newly created project
03Space Ship

Add Burn Dependency and Choose Backend

  1. Cargo simplifies the process of including external libraries. The following command adds the main dependency and specify the [wgpu] backend
04Burn

Start Developing with Burn

  1. With Burn successfully installed, you're now ready to start developing your deep learning projects using this powerful framework.
05

Basic Example

Now open [src/main.rs] and replace its content with:

use burn::tensor::{Tensor, backend::Backend};

fn computation<B: Backend>() {
    // Create the device where to do the computation
    let device = Default::default();

    let tensor1: Tensor<B, 2> = Tensor::from_floats([[2., 3.], [4., 5.]], &device);
    let tensor2 = Tensor::ones_like(&tensor1);

    // Print the element-wise addition of the two tensors.
    println!("{:}", tensor1 + tensor2);
}

fn main() {
    computation::<burn::backend::Wgpu>();
}

And then:

You should now see the result of the addition:

Tensor {
  data: [[3.0, 4.0], [5.0, 6.0]],
  shape: [2, 2],
  device: BestAvailable,
  backend: "fusion<jit<wgpu<wgsl>>>",
  kind: "Float",
  dtype: "f32",
}

While this example is somewhat trivial, the basic workflow section of the Burn Book will walk you through a much more relevant example for deep learning applications.

Stay connected

Join our community! We'd love to keep you in the loop with our newsletter.

unsubscribed
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy