Skip to content

Commit

Permalink
Validate
Browse files Browse the repository at this point in the history
  • Loading branch information
samestep committed Nov 19, 2024
1 parent c3de7f6 commit 59c5af6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/floretta-cli/src/bin/floretta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub fn main() -> anyhow::Result<()> {
wat::parse_bytes(&stdin)?.into_owned()
}
};
let after = floretta::autodiff(&before);
let after = floretta::autodiff(&before)?;
if args.wat {
let string = wasmprinter::print_bytes(after)?;
match args.output {
Expand Down
8 changes: 6 additions & 2 deletions crates/floretta/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
pub fn autodiff(wasm_module: &[u8]) -> Vec<u8> {
wasm_module.to_vec()
//! Reverse-mode automatic differentiation for WebAssembly.
/// Apply reverse-mode automatic differentiation to a WebAssembly module.
pub fn autodiff(wasm_module: &[u8]) -> wasmparser::Result<Vec<u8>> {
wasmparser::validate(wasm_module)?;
Ok(wasm_module.to_vec())
}

0 comments on commit 59c5af6

Please sign in to comment.