Lightning-AI/lightning-thunder

[feature request] Indexing with boolean masks

オープン

#126 opened on 2024/04/03

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Python (114 件のフォーク)github user discovery
enhancementhelp wantedoperators

Repository metrics

Stars
 (1,460 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

🚀 Feature

No indexing with boolean mask, for example:

import torch; import thunder                                                                                   
m = x <= 0.5
                                                                                                                                                                                                                          
def f(x, m):                                                                                                   
    return x[m]                                    
                                                                                                        
                                                                                                                       
jf = thunder.jit(f)                                
jf(x, m)  

fails with

RuntimeError: Advanced indexing currently only supports zero or one-dimensional integer tensors, but found a tensor with dtype bool8 and 1 dimensions

cc @apaz-cli

コントリビューターガイド