FilesLast commitLast update
19 days ago
3 months ago
9 months ago
21 days ago
2 months ago
21 days ago
1 month ago
1 month ago
16 days ago
README

StatelessRandomChoiceWithMask

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: Selects the corresponding index list based on the elements whose values are true in the input x. Then, it calls philox_random with seed and offset to generate a number of random numbers equal to the length of the index list, and uses the random numbers to apply the shuffling algorithm to the index list, obtaining the randomly shuffled index list. count items are returned. If count is 0, the actual number of items in the index list is output. If the list contains fewer than count items, it is padded with 0 to count items. The output mask marks whether each index is a valid index.

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x Input Input x value. BOOL ND
count Input Expected number of output indexes. INT32 ND
seed Input Obtains the random seed. INT64 ND
offset Input Step size for obtaining values. INT64 ND
out Output Indexes of the shuffled elements whose values are true in the input x. INT32 ND
mask Output Marks whether the index at each position is a valid index. BOOL ND

Constraint Description

None

Invocation Description

Invocation Method Invocation Sample Description
Graph-mode invocation test_geir_stateless_random_choice_with_mask Invokes the StatelessRandomChoiceWithMask operator by building a graph through the operator IR.