EyeLike
Description
Generates a 2D matrix with the main diagonal of 1 and other values of 0.
Input
x: input tensor of type float16, float32, int32, int16, int8, uint8, int64, or bool. The shape is 2D for copying the tensor. The supported data format is ND.
Attribute
- dtype (optional): output data type, which can be float16, float, int32, int16, int8, uint8, or int64. If not specified, the data type of the first input is used. If the data type of the first input is not specified, the default float type is used.
- k (optional): The data type is int. The default value is 0, indicating that the main diagonal is broadcast as the index of 1. For example, if y is the output, the calculation formula is y[i, i+k] = 1.
Output
y: output tensor with the same shape as input x.
Constraints
Only k=0 is supported.
ONNX Opset Support
Opset v8/v9/v10/v11/v12/v13/v14/v15/v16/v17/v18
Parent topic: Supported ONNX Operators