Welcome to our Support Center

Get output shape by index

Description

Gets the output size of the layer selected by the index given as input.

Input parameters

 

Model in : model architecture.
Β index :Β integer,Β layer index.

Output parameters

 

Model out : model architecture.

Β output : cluster,

Β Name :Β cluster,

Β node :Β string,Β name of the ONNX node producing the output (e.g.,Β Dense_342_output).
Β output :Β string,Β identifier of the output tensor from this node.

Β index :Β integer,Β index of the node within the ONNX graph, used to performΒ getΒ orΒ setΒ operations on a specific node.
Β output_order :Β integer,Β index of the output (useful to retrieve the data after execution if there are multiple outputs).
Β output_shape :Β array,Β expected shape of the output tensor. This shape is only valid for models using explicitΒ Layers, and the first dimension always corresponds to the batch size (even if shown as 1 here).
Β dtype :Β enum,Β data type of the output tensor (e.g.,Β FLOATΒ for floating-point tensors).

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).

Using the β€œGet Output Shape by index” function

1 – Define Graph

We define two graphs with an input of different size and a Dense layer. We merge the two graphs to have only one and we add a last Dense to the graph. Each Dense layer is parameterized differently.

2 – Merge Function

We use the “Merge” function to merge the two graphs.

3 – Get Function

We use the “Get Output Shape by index” function to get output size of layer at index 3.

Table of Contents