FilesLast commitLast update
2 days ago
10 months ago
9 days ago
22 days ago
22 days ago
10 months ago
6 days ago
1 month ago
21 days ago
6 days ago
README

MaskedFill

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: fills the elements at the positions where mask is True in the input Tensor x with specified values. mask must have the same shape as x or be broadcastable.

  • Computation formula:

    yi={xi,  maski=Falsevaluei,  maski=Truey_i = \begin{cases} x_i, \, \, mask_i=False\\ value_i, \, \, mask_i=True\\ \end{cases}

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x Input Input x in the formula. FLOAT32, FLOAT16, BFLOAT16, INT8, INT16, INT32, INT64, BOOL ND
mask Input Input mask in the formula. BOOL ND
value Input Input value in the formula. FLOAT32, FLOAT16, BFLOAT16, INT8, INT16, INT32, INT64, BOOL ND
y Output Output y in the formula. FLOAT32, FLOAT16, BFLOAT16, INT8, INT16, INT32, INT64, BOOL ND
  • Atlas training products, Atlas inference products, and Atlas 200I/500 A2 inference products: BFLOAT16 is not supported.
  • Only Ascend 950PR&950DT products support INT16 and INT64.

Constraint Description

  • The dtype of value must be the same as that of x.
  • x and mask must satisfy the broadcasting relationship.
  • The shape of y can be obtained by broadcasting x, mask, and value together.

Invocation Description

Invocation Method Sample Code Description
aclnn API test_aclnn_inplace_masked_fill_scalar Invokes the MaskedFill operator through the aclnnInplaceMaskedFillScalar API.