Added shell for Eye-9 (#11210)
This commit is contained in:
committed by
GitHub
parent
76610393a0
commit
9dffa706fb
@@ -11,17 +11,7 @@
|
||||
*Eye* operation generates an identity matrix or a batch matrices with ones on the diagonal and zeros everywhere else. The index of the diagonal to be populated with ones is given by `diagonal_index`: `output[..., i, i + diagonal_index] = 1`.
|
||||
|
||||
|
||||
Example 1. *Eye* output with `output_type` = `f32`:
|
||||
|
||||
```
|
||||
num_rows = 3
|
||||
|
||||
output = [[1. 0. 0.]
|
||||
[0. 1. 0.]
|
||||
[0. 0. 1.]]
|
||||
```
|
||||
|
||||
Example 2. *Eye* output with `output_type` = `i32`:
|
||||
Example 1. *Eye* output with `output_type` = `i32`:
|
||||
|
||||
```
|
||||
num_rows = 3
|
||||
@@ -35,7 +25,7 @@ output = [[0 0 1 0]
|
||||
[0 0 0 0]]
|
||||
```
|
||||
|
||||
Example 3. *Eye* output with `output_type` = `i32`:
|
||||
Example 2. *Eye* output with `output_type` = `i32`:
|
||||
|
||||
```
|
||||
num_rows = 3
|
||||
@@ -49,7 +39,7 @@ output = [[0 0 0 0]
|
||||
[0 1 0 0]]
|
||||
```
|
||||
|
||||
Example 4. *Eye* output with `output_type` = `f16`:
|
||||
Example 3. *Eye* output with `output_type` = `f16`:
|
||||
|
||||
```
|
||||
num_rows = 2
|
||||
@@ -78,9 +68,9 @@ output = [[[[0. 0.]
|
||||
|
||||
* **1**: `num_rows` - scalar or 1D tensor with 1 non-negative element of type *T_NUM* describing the number of rows in matrix. **Required.**
|
||||
|
||||
* **2**: `num_columns` - scalar or 1D tensor with 1 non-negative element of type *T_NUM* describing the number of columns in matrix. This input is optional, and its default value equals to `num_rows`.
|
||||
* **2**: `num_columns` - scalar or 1D tensor with 1 non-negative element of type *T_NUM* describing the number of columns in matrix. **Required.**
|
||||
|
||||
* **3**: `diagonal_index` - scalar or 1D tensor with element of type *T_NUM* describing the index of the diagonal to be populated. A positive value refers to an upper diagonal and a negative value refers to a lower diagonal. Value `0` populates the main diagonal. If `diagonal_index` is a positive value and is not smaller than `num_rows` or if `diagonal_index` is a negative value and is not larger than `num_columns`, the matrix will be filled with only zeros. This input is optional, and its default value equals to `0`.
|
||||
* **3**: `diagonal_index` - scalar or 1D tensor with element of type *T_NUM* describing the index of the diagonal to be populated. A positive value refers to an upper diagonal and a negative value refers to a lower diagonal. Value `0` populates the main diagonal. If `diagonal_index` is a positive value and is not smaller than `num_rows` or if `diagonal_index` is a negative value and is not larger than `num_columns`, the matrix will be filled with only zeros. **Required.**
|
||||
|
||||
* **4**: `batch_shape` - 1D tensor with non-negative values of type *T_NUM* defines leading batch dimensions of output shape. If `batch_shape` is an empty list, *Eye* operation generates a 2D tensor (matrix). This input is optional, and its default value equal to an empty tensor.
|
||||
|
||||
@@ -99,14 +89,16 @@ output = [[[[0. 0.]
|
||||
|
||||
```xml
|
||||
<layer ... name="Eye" type="Eye">
|
||||
<data output_type="i32"/>
|
||||
<data output_type="i8"/>
|
||||
<input>
|
||||
<port id="0" precision="I32"/> <!-- num rows : 10-->
|
||||
<port id="0" precision="I32"/> <!-- num rows: 5 -->
|
||||
<port id="1" precision="I32"/> <!-- num columns: 5 -->
|
||||
<port id="2" precision="I32"/> <!-- diagonal index -->
|
||||
</input>
|
||||
<output>
|
||||
<port id="3" precision="I32" names="Eye:0">
|
||||
<dim>10</dim>
|
||||
<dim>10</dim>
|
||||
<port id="3" precision="I8" names="Eye:0">
|
||||
<dim>5</dim>
|
||||
<dim>5</dim>
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
@@ -114,47 +106,12 @@ output = [[[[0. 0.]
|
||||
|
||||
*Example 2*
|
||||
|
||||
```xml
|
||||
<layer ... name="Eye" type="Eye">
|
||||
<data output_type="i64"/>
|
||||
<input>
|
||||
<port id="0" precision="I32"/> <!-- num rows : 5 -->
|
||||
<port id="1" precision="I32"/> <!-- num columns -->
|
||||
</input>
|
||||
<output>
|
||||
<port id="3" precision="I64" names="Eye:0">
|
||||
<dim>5</dim>
|
||||
<dim>-1</dim>
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
|
||||
*Example 3*
|
||||
|
||||
```xml
|
||||
<layer ... name="Eye" type="Eye">
|
||||
<data output_type="i64"/>
|
||||
<input>
|
||||
<port id="0" precision="I32"/> <!-- num rows -->
|
||||
<port id="2" precision="I32"/> <!-- diagonal index -->
|
||||
</input>
|
||||
<output>
|
||||
<port id="3" precision="I64" names="Eye:0">
|
||||
<dim>-1</dim>
|
||||
<dim>-1</dim>
|
||||
</port>
|
||||
</output>
|
||||
</layer>
|
||||
```
|
||||
|
||||
*Example 4*
|
||||
|
||||
```xml
|
||||
<layer ... name="Eye" type="Eye">
|
||||
<data output_type="f32"/>
|
||||
<input>
|
||||
<port id="0" precision="I32"/> <!-- num rows -->
|
||||
<port id="1" precision="I32"/> <!-- num columns -->
|
||||
<port id="2" precision="I32"/> <!-- diagonal index -->
|
||||
<port id="3" precision="I32"/> <!-- batch_shape : [2, 3] -->
|
||||
</input>
|
||||
|
||||
Reference in New Issue
Block a user