kevinthesun commented on a change in pull request #7018: URL: https://github.com/apache/tvm/pull/7018#discussion_r535663839
########## File path: python/tvm/topi/cuda/sort.py ########## @@ -561,10 +561,11 @@ def topk_thrust(data, k=1, axis=-1, ret_type="both", is_ascend=False, dtype="int tag="topk_gpu", ) - if k > 0: + if not isinstance(k, int) or k > 0: beg = [0] * ndim - end = data.shape[:-1] + [k] - out = [strided_slice(o, beg, end) for o in out] + end = data.shape[:-1] + [k if isinstance(k, int) else tvm.te.size_var("dim")] + strides = [1] * ndim + out = [strided_slice(o, beg, end, strides) for o in out] Review comment: I modified cuda topk so that topk in dyn can pass. However, topk in test any in which data has dynamic shape can't pass without Thrust. I disable that test for now. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org