class HalfGaussianVertex extends GaussianVertex {

    @Override
    public LogProbGraph logProbGraph() {
        final DoublePlaceholderVertex xPlaceholder = new DoublePlaceholderVertex(this.getShape());
        final DoublePlaceholderVertex muPlaceholder = new DoublePlaceholderVertex(getMu().getShape());
        final DoublePlaceholderVertex sigmaPlaceholder = new DoublePlaceholderVertex(getSigma().getShape());

        final DoubleVertex gaussianLogProbOutput = Gaussian.logProbOutput(xPlaceholder, muPlaceholder, sigmaPlaceholder);

        final DoubleVertex result = gaussianLogProbOutput.plus(LOG_TWO);
        final DoubleVertex invalidMask = xPlaceholder.lessThanMask(MU_ZERO);
        final DoubleVertex halfGaussianLogProbOutput = result.setWithMask(invalidMask, Double.NEGATIVE_INFINITY).sum();

        // Set the value of muPlaceholder since we know it's 0.
        muPlaceholder.setValue(MU_ZERO);

        return LogProbGraph.builder()
            .input(this, xPlaceholder)
            .input(getMu(), muPlaceholder)
            .input(getSigma(), sigmaPlaceholder)
            .logProbOutput(halfGaussianLogProbOutput)
            .build();
    }

    public  HalfGaussianVertex(@LoadShape long[] tensorShape,
                              @LoadVertexParam(SIGMA_NAME) Vertex<DoubleTensor, ?> sigma);
    @ExportVertexToPythonBindings public  HalfGaussianVertex(Vertex<DoubleTensor, ?> sigma);
    public  HalfGaussianVertex(double sigma);
    public  HalfGaussianVertex(long[] tensorShape, double sigma);

}