Skip to content

Commit

Permalink
Move rngs to be treated like constants instead
Browse files Browse the repository at this point in the history
  • Loading branch information
BradenEverson committed Apr 8, 2024
1 parent db42976 commit 23d2d34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/graph/autodiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ impl Context {
//Again again, clone() here is not wonderful, there's gotta be a better way to
//store the i64 vec for Transpose
match self.nodes[dependent_node].operation.clone() {
Operation::Constant(_) => panic!("Constant found as dependent node!"),
Operation::Constant(_)
| Operation::RngUniform(_, _, _)
| Operation::RngNormal(_, _, _) => panic!("Constant found as dependent node!"),
Operation::Parameter(_) => panic!("Parameter found as dependent node!"),
Operation::StopGradient(_) => continue,

Expand All @@ -73,8 +75,6 @@ impl Context {
| Operation::LessThan(_, _)
| Operation::LessThanEq(_, _)
| Operation::GreaterThan(_, _)
| Operation::RngNormal(_, _, _)
| Operation::RngUniform(_, _, _)
| Operation::GreaterThanEq(_, _) => {
return Err(ContextError::NonDifferentiableOpError(
self.nodes[dependent_node].callsite.clone(),
Expand Down

0 comments on commit 23d2d34

Please sign in to comment.