arrayfire / arrayfire/arrayfire-dotnet

Error in ar_topk

Đang mở
#33 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C#
Star
76
Fork
19
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello,
I made a TopK function in class Algorithm as below.
Then I created a random array by using Data.RandNormal(4, 225, 16, 292); and pass this array to TopK function with k=4, dim = 0, order = AF_TOPK_MAX.
An exception is happen with "Internal error" message.
Are there any limitation of topk in arrayfire like number of dimensions or number of elements in an dimension?
I do the same test in pytorch. It's work well.

namespace ArrayFire
{
public static class Algorithm
{
.
.
.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Array TopK(out Array indices, Array arr1, int k, int dim, af_topk_function order)
{
IntPtr ptr;
IntPtr idx;
Internal.VERIFY(AFStatistics.af_topk(out ptr, out idx, arr1._ptr, k, dim, order));
indices = new Array(idx);
return new Array(ptr);
}
}
}

public Form1()
{
InitializeComponent();
Device.SetBackend(Backend.CUDA);
try
{
var arr1 = Data.RandNormal(4, 225, 16, 292);
ArrayFire.Array indices = null;
var output = Algorithm.TopK(out indices, arr1, 4, 0, ArrayFire.Interop.af_topk_function.AF_TOPK_MAX);
}
catch (Exception ex) { }
Debug.WriteLine("Done!!");
}

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.