Pad

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference products

Atlas training products

Function Usage

Pads dimensions of an input tensor based on paddings. The padding value is 0.

Prototype

const aclTensor* Pad(const aclTensor* self, const aclTensor* paddings, aclOpExecutor* executor)

Parameters

Parameter

Input/Output

Description

self

Input

Input tensor to be padded. The data type can be FLOAT16, FLOAT, INT16, UINT16, INT32, BFLOAT16, INT8, or INT64. The data format can be ND.

NOTE:

BFLOAT16 and INT8 apply to the following product models:

Atlas A2 training products/Atlas A2 inference products

Atlas A3 training products/Atlas A3 inference products

paddings

Input

Padding sizes of dimensions of the input tensor. The shape is [self.dim, 2]. The data type can be INT32 or INT64, and the data format can be ND.

executor

Input

Operator executor, containing the operator computation process.

Returns

A tensor padded with 0s.

Constraints

None

Examples

1
2
//Call l0op::Pad to perform dimension padding on self.
l0op::Pad(self, paddingsTensor, executor);