diff --git a/autograph_derive/src/lib.rs b/autograph_derive/src/lib.rs index 0ea6115..a44952c 100644 --- a/autograph_derive/src/lib.rs +++ b/autograph_derive/src/lib.rs @@ -195,30 +195,6 @@ impl Layers { } } } - /* - fn try_map(&self, method: Ident, arg: TokenStream2) -> TokenStream2 { - match self { - Self::Struct(layers) => { - quote! { - Ok(Self { - #( - #layers: self.#layers.#method(#arg)?, - )* - }) - } - } - Self::Enum(layers) => { - quote! { - match self { - #( - Self::#layers(layer) => Ok(Self::#layers(layer.#method(#arg)?)), - )* - } - } - } - } - } - */ } enum Layer { @@ -364,7 +340,7 @@ fn forward_impl(input: TokenStream2) -> Result { } /// Derive for Forward. -#[proc_macro_derive(Forward, attributes(autograph, layer))] +#[proc_macro_derive(Forward, attributes(autograph))] pub fn forward(input: TokenStream) -> TokenStream { match forward_impl(input.into()) { Ok(output) => output.into(), diff --git a/src/learn/neural_network/optimizer.rs b/src/learn/neural_network/optimizer.rs index 32c270a..2caddd9 100644 --- a/src/learn/neural_network/optimizer.rs +++ b/src/learn/neural_network/optimizer.rs @@ -156,14 +156,6 @@ impl<'a> ValueMut<'a> { panic!("Expected tensor!") } } - /* - fn unwrap_elem(self) -> ScalarElem { - if let Self::Elem(elem) = self { - *elem - } else { - panic!("Expected elem!") - } - }*/ } /// Optimizer State.