Error in ar_topk
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the reported C# call using Data.RandNormal(4, 225, 16, 292), Device.SetBackend(Backend.CUDA), and Algorithm.TopK with k=4 and dim=0. Start at the AFStatistics.af_topk invocation and determine whether the shape or arguments trigger the internal error; done means the limitation or wrapper failure is identified and documented or corrected.
Written by the indexing model from the issue text.
Description
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<float>(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!!");
}
- Dominant language
- C#
- Stars
- 76
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from arrayfire/arrayfire-dotnet
-
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
-
af_index_t Openquestion
Difficulty 5/5 Over a week Newbie friendliness 20/100
arrayfire/arrayfire-dotnet#31 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
arrayfire/arrayfire-dotnet#29 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
arrayfire/arrayfire-dotnet#27 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
arrayfire/arrayfire-dotnet#25 · 5 comments ·
All issues in arrayfire/arrayfire-dotnet
Similar issues
-
Status: Waiting triage Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
nanoframework/Home#1857 ·
-
kind/bug kind/regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
unoplatform/uno.toolkit.ui#1646 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nightscout/nocturne#1379 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
elastic/esql-dotnet#47 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100