### Question:
UniformVertex extends VertexImpl<DoubleTensor, DoubleVertex> implements DoubleVertex, Differentiable, ProbabilisticDouble, SamplableWithManyScalars<DoubleTensor>, LogProbGraphSupplier { @Override public LogProbGraph logProbGraph() { final DoublePlaceholderVertex xPlaceholder = new DoublePlaceholderVertex(this.getShape()); final DoublePlaceholderVertex xMinPlaceholder = new DoublePlaceholderVertex(xMin.getShape()); final DoublePlaceholderVertex xMaxPlaceholder = new DoublePlaceholderVertex(xMax.getShape()); return LogProbGraph.builder() .input(this, xPlaceholder) .input(xMin, xMinPlaceholder) .input(xMax, xMaxPlaceholder) .logProbOutput(Uniform.logProbOutput(xPlaceholder, xMinPlaceholder, xMaxPlaceholder)) .build(); } UniformVertex(@LoadShape long[] tensorShape,
                         @LoadVertexParam(X_MIN_NAME) Vertex<DoubleTensor, ?> xMin,
                         @LoadVertexParam(X_MAX_NAME) Vertex<DoubleTensor, ?> xMax); @ExportVertexToPythonBindings  UniformVertex(Vertex<DoubleTensor, ?> xMin, Vertex<DoubleTensor, ?> xMax);  UniformVertex(Vertex<DoubleTensor, ?> xMin, double xMax);  UniformVertex(double xMin, Vertex<DoubleTensor, ?> xMax);  UniformVertex(double xMin, double xMax);  UniformVertex(long[] tensorShape, Vertex<DoubleTensor, ?> xMin, double xMax);  UniformVertex(long[] tensorShape, double xMin, Vertex<DoubleTensor, ?> xMax);  UniformVertex(long[] tensorShape, double xMin, double xMax); @SaveVertexParam(X_MIN_NAME) DoubleVertex getXMin(); @SaveVertexParam(X_MAX_NAME) DoubleVertex getXMax(); @Override double logProb(DoubleTensor value); @Override LogProbGraph logProbGraph(); @Override Map<Vertex, DoubleTensor> dLogProb(DoubleTensor value, Set<? extends Vertex> withRespectTo); @Override DoubleTensor sampleWithShape(long[] shape, KeanuRandom random);  }### Answer:
@Test public void logProbGraphUpperBoundIsNegativeInfinity() { DoubleVertex xMin = ConstantVertex.of(lowerBound); DoubleVertex xMax = ConstantVertex.of(upperBound); UniformVertex uniformVertex = new UniformVertex(xMin, xMax); LogProbGraph logProbGraph = uniformVertex.logProbGraph(); LogProbGraphValueFeeder.feedValue(logProbGraph, xMin, xMin.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, xMax, xMax.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, uniformVertex, DoubleTensor.scalar(upperBound)); LogProbGraphContract.matchesKnownLogDensity(logProbGraph, Double.NEGATIVE_INFINITY); }
@Test public void logProbGraphLowerBoundIsNotNegativeInfinity() { DoubleVertex xMin = ConstantVertex.of(lowerBound); DoubleVertex xMax = ConstantVertex.of(upperBound); UniformVertex uniformVertex = new UniformVertex(xMin, xMax); LogProbGraph logProbGraph = uniformVertex.logProbGraph(); LogProbGraphValueFeeder.feedValue(logProbGraph, xMin, xMin.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, xMax, xMax.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, uniformVertex, DoubleTensor.scalar(lowerBound)); UniformRealDistribution uniformRealDistribution = new UniformRealDistribution(lowerBound, upperBound); double expectedDensity = uniformRealDistribution.logDensity(lowerBound); assertThat(expectedDensity, not(equalTo(Double.NEGATIVE_INFINITY))); LogProbGraphContract.matchesKnownLogDensity(logProbGraph, expectedDensity); }