Added default for isGradientRetainsLeafNodesOnly if factory is missing.
@@ -442,7 +442,7 @@ public class RandomVariableDifferentiableAAD implements RandomVariableDifferenti
}
private boolean isGradientRetainsLeafNodesOnly() {
- return getFactory().isGradientRetainsLeafNodesOnly();
+ return getFactory() != null ? getFactory().isGradientRetainsLeafNodesOnly() : false;
}
/*
@@ -1045,4 +1045,9 @@ public class RandomVariableDifferentiableAAD implements RandomVariableDifferenti
OperatorType.MAX,
getFactory());
}
+
+ @Override
+ public String toString() {
+ return "RandomVariableDifferentiableAAD [values=" + values + ", ID=" + getID() + "]";
+ }
}
