| Files | Last commit | Last update |
|---|---|---|
| 2 months ago | ||
| 2 months ago | ||
| 21 days ago | ||
| 14 days ago | ||
| 19 days ago | ||
| 1 month ago | ||
| 15 days ago | ||
| 19 days ago | ||
| 15 days ago | ||
| 6 days ago |
Pad
English | 简体中文
Product Support Status
| Product | Supported |
|---|---|
| Ascend 950PR&950DT products | √ |
| Atlas A3 products | √ |
| Atlas A2 products | √ |
| Atlas 200I/500 A2 inference products | √ |
| Atlas inference products | √ |
| Atlas training products | √ |
Function Description
-
Operator function: pads the beginning and end of each dimension of input x with a constant according to the configuration of the input paddings, and the padding value is 0. This operator is compatible with the Pad operator of TensorFlow.
-
Example:
Input x = [[0,1,2]], shape is [1,3] paddings = [[1,1],[2,2]] Output y = [[0,0,0,0,0,0,0], [0,0,0,1,2,0,0], [0,0,0,0,0,0,0]], shape is [3,7]
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x | Input | Original tensor to be padded. | BFLOAT16, FLOAT16, FLOAT, DOUBLE, INT32, UINT8, INT16, INT8, COMPLEX64, INT64, QINT8, QUINT8, QINT32, QINT16, QUINT16, UINT16, COMPLEX128, UINT32, UINT64, BOOL, HIFLOAT8, FLOAT8_E5M2, FLOAT8_E4M3FN, FLOAT8_E8M0, FLOAT4_E2M1, FLOAT4_E1M2. | ND |
| paddings | Input | Configuration of padding. The shape is [rank(x), 2], and row i [a, b] indicates that a elements are padded at the beginning of dimension i of x and b elements are padded at the end. | INT32, INT64 | ND |
| y | Output | Tensor after padding. Its data type is the same as that of x. | Same as the data type of x | ND |
- Data types supported by the AICore path vary with the platform:
- Atlas A2 products: FLOAT, FLOAT16, BFLOAT16, INT8, INT16, INT32, UINT16, INT64;
- Some new-generation platforms additionally support the following types: UINT8, UINT32, UINT64, BOOL, HIFLOAT8, FLOAT8_E5M2, FLOAT8_E4M3FN, FLOAT8_E8M0, FLOAT4_E2M1, FLOAT4_E1M2;
- Other platforms: FLOAT, FLOAT16, BFLOAT16, INT16, INT32, UINT16, INT64.
- Data types not in the preceding AICore support list (such as DOUBLE, COMPLEX64, COMPLEX128, and QINT8) are computed through the AICPU path.
Constraint Description
- The shape of paddings must be [rank(x), 2], where rank(x) is the number of dimensions of input x.
- If the data type of x is FLOAT4_E2M1 or FLOAT4_E1M2, the value of paddings should be an even number.
- If the data type of x is HIFLOAT8, FLOAT8_E5M2, FLOAT8_E4M3FN, or FLOAT8_E8M0, the value of paddings should be a non-negative integer.
Invocation Description
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| GE graph mode | test_geir_pad | Invokes the Pad operator by building a graph through the operator IR. |