Welcome to our Support Center

EyeLike

Description

Generate a 2D tensor (matrix) with ones on the diagonal and zeros everywhere else. Only 2D tensors are supported, i.e. input T1 must be of rank 2. The shape of the output tensor is the same as the input tensor. The data type can be specified by the ‘dtype’ argument. If ‘dtype’ is not specified, then the type of input tensor is used. By default, the main diagonal is populated with ones, but attribute ‘k’ can be used to populate upper or lower diagonals. The ‘dtype’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message and be valid as an output type.

 

Input parameters

 

specified_outputs_namearray, this parameter lets you manually assign custom names to the output tensors of a node.
 input (heterogeneous) – T1 : object, 2D input tensor to copy shape, and optionally, type information from.

 Parameters : cluster,

dtype : enum, the data type for the elements of the output tensor. If not specified,the data type of the input tensor T1 is used. If input tensor T1 is also notspecified, then type defaults to ‘float’.
Default value “UNDEFINED”.
k : integer, Index of the diagonal to be populated with ones. Default is 0. If T2 is the output, this op sets T2[i, i+k] = 1. k = 0 populates the main diagonal, k > 0 populates an upper diagonal, and k < 0 populates a lower diagonal.
Default value “0”.
 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) – T2 : object, output tensor, same shape as input tensor T1.

Type Constraints

T1 in (tensor(bool)tensor(double)tensor(float)tensor(float16)tensor(int16)tensor(int32)tensor(int64)tensor(int8)
tensor(uint16)tensor(uint32)tensor(uint64)tensor(uint8)) : Constrain input types. Strings and complex are not supported.

T2 in (tensor(bool)tensor(double)tensor(float)tensor(float16)tensor(int16)tensor(int32)tensor(int64)tensor(int8)
tensor(uint16)tensor(uint32)tensor(uint64)tensor(uint8)) : Constrain output types. Strings and complex are not supported.

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