From 23d2d345f313ee24a4bc9eac69e2ddcb37cc9ac4 Mon Sep 17 00:00:00 2001 From: Braden Everson Date: Mon, 8 Apr 2024 08:02:06 -0500 Subject: [PATCH] Move rngs to be treated like constants instead --- src/core/graph/autodiff.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/graph/autodiff.rs b/src/core/graph/autodiff.rs index b802d8b..b54faee 100644 --- a/src/core/graph/autodiff.rs +++ b/src/core/graph/autodiff.rs @@ -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, @@ -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(),