Welcome to our Support Center

OptionalHasElement

Description

Returns true if (1) the input is an optional-type and contains an element, or, (2) the input is a tensor or sequence type. If the input is not provided or is an empty optional-type, this op returns false.

 

Input parameters

 

specified_outputs_namearray, this parameter lets you manually assign custom names to the output tensors of a node.
 input (optional, heterogeneous) – O : object, the optional input.

 Parameters : cluster,

 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

 

 output (heterogeneous) – B : object, a scalar boolean tensor. If true, it indicates that optional-type input contains an element. Otherwise, it is empty.

Type Constraints

O in (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(bool))optional(tensor(complex128))optional(tensor(complex64))optional(tensor(double))optional(tensor(float))optional(tensor(float16))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(bool))seq(tensor(complex128))seq(tensor(complex64))seq(tensor(double))seq(tensor(float))seq(tensor(float16))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(bool)tensor(complex128)tensor(complex64)tensor(double)tensor(float)tensor(float16)tensor(int16)tensor(int32)tensor(int64)tensor(int8)tensor(string)tensor(uint16)tensor(uint32)tensor(uint64)tensor(uint8)) : Constrain input type to optional tensor and optional sequence types.

B in (tensor(bool)) : Constrain output to a boolean tensor.

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