burn_remote/
lib.rs

1#[macro_use]
2extern crate derive_new;
3
4#[cfg(feature = "client")]
5pub(crate) mod client;
6
7#[cfg(feature = "server")]
8pub mod server;
9
10pub(crate) mod shared;
11
12#[cfg(feature = "client")]
13mod __client {
14    use super::*;
15
16    use burn_router::BackendRouter;
17    use client::WsChannel;
18
19    /// The remote backend allows you to run computation on a remote device.
20    ///
21    /// Make sure there is a running server before trying to connect to it.
22    ///
23    /// ```rust, ignore
24    /// fn main() {
25    ///     let device = Default::default();
26    ///     let port = 3000;
27    ///
28    ///     // You need to activate the `server` feature flag to have access to this function.
29    ///     burn::server::start::<burn::backend::Wgpu>(device, port);
30    /// }
31    ///```
32    pub type RemoteBackend = BackendRouter<WsChannel>;
33
34    pub use client::WsDevice as RemoteDevice;
35}
36#[cfg(feature = "client")]
37pub use __client::*;