Skip to content

Commit

Permalink
cleanup + fix derive docs
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-r-earp committed Mar 30, 2024
1 parent 2511182 commit 58faf3f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
26 changes: 1 addition & 25 deletions autograph_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -364,7 +340,7 @@ fn forward_impl(input: TokenStream2) -> Result<TokenStream2> {
}

/// 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(),
Expand Down
8 changes: 0 additions & 8 deletions src/learn/neural_network/optimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 58faf3f

Please # to comment.