arrayfire / arrayfire/arrayfire-dotnet
Error in ar_topk
- Langage dominant
- C#
- Étoiles
- 76
- Forks
- 19
- Métriques de merge des PR
- Aucune PR mergée en 30 j
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(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!!");
}
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Reproduisez l’appel C# signalé avec Data.RandNormal(4, 225, 16, 292), Device.SetBackend(Backend.CUDA) et Algorithm.TopK avec k=4 et dim=0. Commencez par l’invocation de AFStatistics.af_topk et déterminez si la forme ou les arguments déclenchent l’erreur interne ; le travail est terminé lorsque la limitation ou l’échec du wrapper est identifié et documenté ou corrigé.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- csharp
- Domaine
- backend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100