Welcome to our Support Center

GemmaRotaryEmbedding

Description

GemmaRotaryEmbedding is the implementation of below part of rotary positional embeddings (RoPE). It implements below from modeling_gemma.py.

 

Input parameters

 

specified_outputs_namearray, this parameter lets you manually assign custom names to the output tensors of a node.

 Graphs in : cluster, ONNX model architecture.

emb (heterogeneous) – U : object, embedding – 3D tensor with shape (batch_size, seq_len, dim).
q (heterogeneous) – T : object, q state – 4D tensor with shape (batch_size, num_heads, seq_len, dim).
q_rot (heterogeneous) – T : object, half rotated q state – 4D tensor with shape (batch_size, num_heads, seq_len, dim).
k (heterogeneous) – T : object, k state – 4D tensor with shape (batch_size, num_heads, seq_len, dim).
k_rot (heterogeneous) – T : object, k state – 4D tensor with shape (batch_size, num_heads, seq_len, dim).

 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

 Graphs out : cluster, ONNX model architecture.

output1 (heterogeneous) – T : object, 4D tensor with shape (batch_size, num_heads, seq_len, dim).
output2 (heterogeneous) – T : object, 4D tensor with shape (batch_size, num_heads, seq_len, dim).

Type Constraints

T in (tensor(float16)) : Constrain input and output types to float16 tensors.

U in (tensor(float)) : Constrain input 0 type to float 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).
Table of Contents