FilesLast commitLast update
9 days ago
10 months ago
3 months ago
8 days ago
10 months ago
8 days ago
8 days ago
5 months ago
8 days ago
28 days ago
8 days ago
9 days ago
README

OnesLike

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: returns a tensor with the same shape and type, with all elements set to 1.

  • Computation formula:

    selfRefi=1 {selfRef}_{i} = 1

  • Example:

    Input input:
    tensor([[1, 2],
            [3, 4]])
    Output output:
    tensor([[1, 1],
            [1, 1]])
    

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x Input Input parameter for the oneslike computation, which is selfRef in the formula. FLOAT, FLOAT16, BFLOAT16, INT8, INT32, UINT8, BOOL ND
y Output Output parameter for the oneslike computation. The selfRef tensor is filled with all 1s. FLOAT, FLOAT16, BFLOAT16, INT8, INT32, UINT8, BOOL ND

Constraint Description

None

Invocation Description

Invocation Method Invocation Sample Description
aclnn invocation test_aclnn_inplace_one Invokes the OnesLike operator through the aclnnInplaceOne API.