### Question:
StudentTVertex extends VertexImpl<DoubleTensor, DoubleVertex> implements DoubleVertex, Differentiable, ProbabilisticDouble, SamplableWithManyScalars<DoubleTensor>, LogProbGraphSupplier { @Override public LogProbGraph logProbGraph() { final DoublePlaceholderVertex xPlaceholder = new DoublePlaceholderVertex(this.getShape()); final IntegerPlaceholderVertex vPlaceholder = new IntegerPlaceholderVertex(v.getShape()); return LogProbGraph.builder() .input(this, xPlaceholder) .input(v, vPlaceholder) .logProbOutput(StudentT.logProbOutput(xPlaceholder, vPlaceholder)) .build(); } StudentTVertex(@LoadShape long[] tensorShape,
                          @LoadVertexParam(V_NAME) Vertex<IntegerTensor, ?> v);  StudentTVertex(long[] tensorShape, int v); @ExportVertexToPythonBindings  StudentTVertex(IntegerVertex v);  StudentTVertex(int v); @SaveVertexParam(V_NAME) IntegerVertex getV(); @Override double logProb(DoubleTensor t); @Override LogProbGraph logProbGraph(); @Override Map<Vertex, DoubleTensor> dLogProb(DoubleTensor t, Set<? extends Vertex> withRespect); @Override DoubleTensor sampleWithShape(long[] shape, KeanuRandom random);  }### Answer:
@Test public void logProbGraphMatchesKnownLogDensityOfScalar() { IntegerVertex v = ConstantVertex.of(1); StudentTVertex studentT = new StudentTVertex(v); LogProbGraph logProbGraph = studentT.logProbGraph(); LogProbGraphValueFeeder.feedValue(logProbGraph, v, v.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, studentT, DoubleTensor.scalar(-4.5)); TDistribution distribution = new TDistribution(1); double expectedDensity = distribution.logDensity(-4.5); LogProbGraphContract.matchesKnownLogDensity(logProbGraph, expectedDensity); }
@Test public void logProbGraphMatchesKnownLogDensityOfVector() { IntegerVertex v = ConstantVertex.of(1, 1); StudentTVertex studentT = new StudentTVertex(v); LogProbGraph logProbGraph = studentT.logProbGraph(); LogProbGraphValueFeeder.feedValue(logProbGraph, v, v.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, studentT, DoubleTensor.create(-4.5, 4.5)); TDistribution distribution = new TDistribution(1); double expectedDensity = distribution.logDensity(-4.5) + distribution.logDensity(4.5); LogProbGraphContract.matchesKnownLogDensity(logProbGraph, expectedDensity); }