If

Description

If conditional.

 

Input parameters

 

specified_outputs_name :Β array, this parameter lets you manually assign custom names to the output tensors of a node.
Β cond (heterogeneous) – B : object, condition for the if. The tensor must contain a single element.

Β Parameters :Β cluster,

else_branch : object, graph to run if condition is false. Has N outputs: values you wish to be live-out to the enclosing scope. The number of outputs must match the number of outputs in the then_branch.
then_branchΒ : object, graph to run if condition is true. Has N outputs: values you wish to be live-out to the enclosing scope. The number of outputs must match the number of outputs in the else_branch.
Β training?Β :Β boolean, whether the layer is in training mode (can store data for backward).
Default value β€œTrue”.
Β lda coeff :Β float, defines the coefficient by which the loss derivative will be multiplied before being sent to the previous layer (since during the backward run we go backwards).
Default value β€œ1”.

Β name (optional) :Β string, name of the node.

Output parameters

 

Β outputs (variadic) – V : array, values that are live-out to the enclosing scope. The return values in theΒ then_branchΒ andΒ else_branchΒ must be of the same data type. TheΒ then_branchΒ andΒ else_branchΒ may produce tensors with the same element type and different shapes. If corresponding outputs from the then-branch and the else-branch have static shapes S1 and S2, then the shape of the corresponding output variable of the if-node (if present) must be compatible with both S1 and S2 as it represents the union of both possible shapes.For example, if in a model file, the first output ofΒ then_branchΒ is typed float tensor with shape [2] and the first output ofΒ else_branchΒ is another float tensor with shape [3], If’s first output should have (a) no shape set, or (b) a shape of rank 1 with neitherΒ dim_valueΒ norΒ dim_paramΒ set, or Β© a shape of rank 1 with a uniqueΒ dim_param. In contrast, the first output cannot have the shape [2] since [2] and [3] are not compatible.

Type Constraints

V in (optional(seq(tensor(bfloat16))),Β optional(seq(tensor(bool))),Β optional(seq(tensor(complex128))),Β 
optional(seq(tensor(complex64))),Β optional(seq(tensor(double))),Β optional(seq(tensor(float))),Β optional(seq(tensor(float16))),Β optional(seq(tensor(int16))),Β optional(seq(tensor(int32))),Β optional(seq(tensor(int64))),Β optional(seq(tensor(int8))),Β optional(seq(tensor(string))),Β optional(seq(tensor(uint16))),Β optional(seq(tensor(uint32))),Β optional(seq(tensor(uint64))),Β optional(seq(tensor(uint8))),Β optional(tensor(bfloat16)),Β optional(tensor(bool)),Β optional(tensor(complex128)),Β optional(tensor(complex64)),Β optional(tensor(double)),Β optional(tensor(float)),Β optional(tensor(float16)),Β optional(tensor(float8e4m3fn)),Β optional(tensor(float8e4m3fnuz)),Β optional(tensor(float8e5m2)),Β optional(tensor(float8e5m2fnuz)),Β optional(tensor(int16)),Β optional(tensor(int32)),Β optional(tensor(int64)),Β optional(tensor(int8)),Β optional(tensor(string)),Β optional(tensor(uint16)),Β optional(tensor(uint32)),Β optional(tensor(uint64)),Β optional(tensor(uint8)),Β seq(tensor(bfloat16)),Β seq(tensor(bool)),Β seq(tensor(complex128)),Β seq(tensor(complex64)),Β seq(tensor(double)),Β seq(tensor(float)),Β seq(tensor(float16)),Β seq(tensor(float8e4m3fn)),Β seq(tensor(float8e4m3fnuz)),Β seq(tensor(float8e5m2)),Β seq(tensor(float8e5m2fnuz)),Β seq(tensor(int16)),Β seq(tensor(int32)),Β seq(tensor(int64)),Β seq(tensor(int8)),Β seq(tensor(string)),Β seq(tensor(uint16)),Β seq(tensor(uint32)),Β seq(tensor(uint64)),Β seq(tensor(uint8)),Β tensor(bfloat16),Β tensor(bool),Β tensor(complex128),Β tensor(complex64),Β tensor(double),Β tensor(float),Β tensor(float16),Β tensor(float8e4m3fn),Β tensor(float8e4m3fnuz),Β tensor(float8e5m2),Β tensor(float8e5m2fnuz),Β tensor(int16),Β tensor(int32),Β tensor(int64),Β tensor(int8),Β tensor(string),Β tensor(uint16),Β tensor(uint32),Β tensor(uint64),Β tensor(uint8)) : All Tensor, Sequence(Tensor), Optional(Tensor), and Optional(Sequence(Tensor)) types up to IRv9.

B in (tensor(bool)) : Only bool.

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install Deep Learning library to run it).
Table of Contents