Click or drag to resize
VariableIf Method
Microsoft Research
Opens a stochastic if statement, active when the argument is true.

Namespace: MicrosoftResearch.Infer.Models
Assembly: Infer.Compiler (in Infer.Compiler.dll) Version: 2.7.1803.2803 (2.7.1803.2803)
public static IfBlock If(
	Variable<bool> b


Type: MicrosoftResearch.Infer.ModelsVariableBoolean
The condition of the if block

Return Value

Type: IfBlock
An IfBlock object which must be closed before inference is performed.
This method should be used as the argument to a using() statement, so that the if statement is automatically closed. If this is not possible, the returned IfBlock must be closed manually by calling CloseBlock().
See Also