burn-onnx 0.21.0-pre.3

Library for importing ONNX models into the Burn framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use proc_macro2::TokenStream;
use rust_format::{Config, Formatter, PostProcess, PrettyPlease};

/// Formats a token stream into a string.
pub fn format_tokens(tokens: TokenStream) -> String {
    let fmt = code_formatter();

    fmt.format_tokens(tokens).expect("Valid token tree")
}

fn code_formatter() -> PrettyPlease {
    let config = Config::new_str().post_proc(PostProcess::ReplaceMarkersAndDocBlocks);

    PrettyPlease::from_config(config)
}