Skip to content

Commit

Permalink
Add .unwrap() to backward calls
Browse files Browse the repository at this point in the history
  • Loading branch information
elftausend committed Aug 25, 2024
1 parent e991361 commit bec7d3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/unary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ mod tests {
);

// out.backward();
out.backward();
out.backward().unwrap();
roughly_eq_slices(
&buf.grad().read_to_vec(),
&[
Expand Down Expand Up @@ -272,7 +272,7 @@ mod tests {
],
);

out.backward();
out.backward().unwrap();
assert_eq!(
buf.grad().as_slice(),
[
Expand Down Expand Up @@ -302,7 +302,7 @@ mod tests {
-0.7568024953079282,
],
);
$out.replace().backward();
$out.replace().backward().unwrap();
roughly_eq_slices(
$buf.replace().grad().as_slice(),
&[
Expand Down Expand Up @@ -391,7 +391,7 @@ mod tests {
}
}
let out = device.unary_ew(&buf, |x| x.sin(), |x| x.cos());
out.backward();
out.backward().unwrap();

roughly_eq_slices(
buf.grad().as_slice(),
Expand Down

0 comments on commit bec7d3d

Please sign in to comment.