candle_einops_macros/
lib.rs

1mod einops;
2
3/// Macro to perform tensor transformations using simple expressions
4///
5/// # Example
6///
7/// ```no_run
8/// let output = einops!("h w c -> c h w", &input);
9/// ```
10#[proc_macro]
11pub fn einops(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
12    einops::einops(input.into())
13        .unwrap_or_else(|e| e.to_compile_error())
14        .into()
15}