FilesLast commitLast update
22 days ago
10 months ago
2 months ago
10 days ago
1 month ago
10 days ago
10 days ago
2 months ago
10 days ago
1 month ago
15 days ago
README

Slice

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: extracts a slice from a tensor. This operation extracts a slice of "size" from the tensor "x", where the start position is specified by "offsets".

y=x[offsets:offsets+size]y = x[offsets:offsets + size]

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x Input Input tensor INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT, FLOAT16, BF16, BOOL, HIFLOAT8, FLOAT8_E5M2, FLOAT8_E4M3FN ND
offsets Input Start position of the slice INT32, INT64 ND
size Input Size of the slice INT32, INT64 ND
y Output Output tensor INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT, FLOAT16, BF16, BOOL, HIFLOAT8, FLOAT8_E5M2, FLOAT8_E4M3FN ND

Constraint Description

  • For each dimension n of the input x, the following condition must be satisfied: 0 <= offsets[i] <= offsets[i] + size[i] <= x_dim[i] for i in [0,n].

Invocation Description

Invocation Method Sample Code Description
aclnn invocation test_aclnn_slice Invokes the Slice operator through the aclnnSlice API