revert changes to place holders in logprob graph
@@ -25,11 +25,7 @@ public class LogProbGraph {
*/
@Getter
@Singular
- private final Map<Vertex<?>, Vertex<?>> inputs;
-
- public <T> Vertex<T> getInput(Vertex<T> input) {
- return (Vertex<T>) inputs.get(input);
- }
+ private final Map<Vertex<?>, PlaceholderVertex<?>> inputs;
/**
* A vertex representing the result of log probability computation
@@ -41,7 +37,7 @@ public class LogProbGraph {
return (Vertex<T>) inputs.get(input);
}
- static public class DoublePlaceholderVertex extends DoubleVertex implements NonProbabilistic<DoubleTensor>, Differentiable, NonSaveableVertex {
+ static public class DoublePlaceholderVertex extends DoubleVertex implements PlaceholderVertex<DoubleTensor>, NonProbabilistic<DoubleTensor>, Differentiable, NonSaveableVertex {
public DoublePlaceholderVertex(long... initialShape) {
super(initialShape);
@@ -54,7 +50,7 @@ public class LogProbGraph {
}
- static public class IntegerPlaceholderVertex extends IntegerVertex implements NonProbabilistic<IntegerTensor>, Differentiable, NonSaveableVertex {
+ static public class IntegerPlaceholderVertex extends IntegerVertex implements PlaceholderVertex<IntegerTensor>, NonProbabilistic<IntegerTensor>, Differentiable, NonSaveableVertex {
public IntegerPlaceholderVertex(long... initialShape) {
super(initialShape);
@@ -67,7 +63,7 @@ public class LogProbGraph {
}
- static public class BooleanPlaceholderVertex extends BooleanVertex implements NonProbabilistic<BooleanTensor>, Differentiable, NonSaveableVertex {
+ static public class BooleanPlaceholderVertex extends BooleanVertex implements PlaceholderVertex<BooleanTensor>, NonProbabilistic<BooleanTensor>, Differentiable, NonSaveableVertex {
public BooleanPlaceholderVertex(long... initialShape) {
super(initialShape);
@@ -80,6 +76,8 @@ public class LogProbGraph {
}
+ private interface PlaceholderVertex<T> {
+ }
private static <T> T getPlaceholderVertexValue(Vertex<T> vertex) {
if (!vertex.hasValue()) {
