k2 之 ragged ops (二)

技术

Index

  
/*  
  Indexing operation on ragged tensor's shape.  
  
      @param [in] src      Source ragged tensor to index  
      @param [in] axis     Axis to index `src` on, must satisfy  
                           0 <= src < src.NumAxes().  
      @param [in] indexes  Array of indexes, which will be interpreted  
                           as indexes into axis `axis` of `src`,  
                           i.e. with 0 <= indexes[i] < src.TotSize(axis).  
  
                           As a special case, if axis == 0 we also support  
                           -1 as an index, which will result in the  
                           empty list (as if it were the index into  
                           a position in `src` that had an empty list  
                           at that point).  
  
                           CAUTION: these are currently not allowed to  
                           change the order on axes less than `axis`,  
                           i.e. if axis > 0, we require.  
                           `IsMonotonic(src.RowIds(axis)[indexes])`.  
  
      @param [out]         If non-null, this will be set to an  
                           Array1<int32\_t> containing the indexes  
                           into the elements of an array with shape  
                           'src', that an array with shape 'ans'  
                           would have (a new2old map).  As in:  
                           `ans\_values = src\_values[*elem\_indexes]`.  
                           If `axis == src.NumAxes()-1`, this will  
                           be aliased with `indexes`.  
  
      @return Returns a ragged shape with  
              `ans.NumAxes() == src.NumAxes()`  
              and `ans.TotSize(axis) == indexes.Dim()`.  
  
  NOET: if you are looking for something like ReorderRaggedShape(),  
  RenumberRaggedShape() or the like, this may be what you want.  
  (Reordering/renumbering is a special case of indexing)  
*/  

0
0
0
0
关于作者

文章

0

获赞

0

收藏

0

相关资源
字节跳动大数据容器化构建与落地实践
随着字节跳动旗下业务的快速发展,数据急剧膨胀,原有的大数据架构在面临日趋复杂的业务需求时逐渐显现疲态。而伴随着大数据架构向云原生演进的行业趋势,字节跳动也对大数据体系进行了云原生改造。本次分享将详细介绍字节跳动大数据容器化的演进与实践。
相关产品
评论
未登录
看完啦,登录分享一下感受吧~
暂无评论