| Files | Last commit | Last update |
|---|---|---|
| 2 months ago | ||
| 25 days ago | ||
| 8 days ago | ||
| 2 days ago | ||
| 25 days ago | ||
| 2 days ago | ||
| 25 days ago | ||
| 1 month ago | ||
| 6 days ago |
AsStrided
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: allows you to create a tensor view that shares the same data memory with the original tensor by specifying a new shape (size) and strides (stride).
-
Computation formula:
outi=inputstorage_offset+∑d=0D−1(id⋅strided[d])out_i=input_{\text{storage\_offset}+\sum_{d=0}^{D-1}(i_d\cdot \text{strided}[d])}
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x | Input | Input parameter, which is input_i in the formula. | INT64, UINT64, INT32, UINT32, FLOAT, FLOAT16, INT8, UINT8, BF16, INT16, UINT16, BOOL, COMPLEX32, COMPLEX64, HIFLOAT8, FLOAT8_E5M2, FLOAT8_E4M3FN | ND |
| size | Input | Shape of the output tensor. | INT32, INT64 | ND |
| stride | Input | stride[d] is the stride of the input tensor along dimension d. | INT32, INT64 | ND |
| storage_offset | Input | Offset of out_i relative to the storage of the original tensor input_i. | INT32, INT64 | ND |
| y | Output | Output parameter, which is out_i in the formula. | INT64, UINT64, INT32, UINT32, FLOAT, FLOAT16, INT8, UINT8, BF16, INT16, UINT16, BOOL, COMPLEX32, COMPLEX64, HIFLOAT8, FLOAT8_E5M2, FLOAT8_E4M3FN | ND |
Constraint Description
None
Invocation Description
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| Graph-mode invocation | test_geir_as_strided | Invokes the as_strided operator by building a graph through the operator IR. |