arrayfire / arrayfire/arrayfire-dotnet
Error in assignment to multidimensional arrays
- 主要語言
- C#
- 星號
- 76
- 分支
- 19
- PR 合併指標
- 30 天內沒有已合併 PR
描述
There's a problem with [] (indexing) operator. Indexing with with one number can be used to read value from the entire table, but it cannot be used to write to multidimensional table. While indexing with 2 or more numbers you can write to any table.
I am not sure, if it is the consequence of C implementation or problem with the wrapper, but this behavior is very unintuitive.
Checked on CPU and OpenCL Backend.
I'll try to fix it on my own
There's an example of the problem
```
ArrayFire.Array A1D = Data.CreateArray(new int[] { 1, 2, 4 });
A1D[1] = Data.CreateArray(new int[] { 100 });
Util.Print(A1D, "A1");
A2D[0, 0] = Data.CreateArray(new int[] { 11 });
A2D[1] = Data.CreateArray(new int[] { 100 });
Util.Print(A2D, "A");
A3D[1,1,1] = Data.CreateArray(new int[] { 100 });
A3D[0, 1] = Data.CreateArray(new int[] { 100 });
A3D[0] = Data.CreateArray(new int[] { 100 });
Util.Print(A3D[1,1], "A3D");
```
Generates the output
```
A1D
[3 1 1 1]
1
100
4
A2D
[3 3 1 1]
100 -1 4
2 2 2
4 0 3
A3D
[2 2 2 1]
1 100
2 -1
2 4
0 100
```
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
從 .NET wrapper 中的 [] 索引與指定入口開始,然後在 CPU 和 OpenCL 後端上分別重現所提供的 A1D、A2D 和 A3D 範例。追蹤對多維陣列進行單一索引寫入時,是由 wrapper 還是由 ArrayFire 實作處理;當文件中記載的指定案例在兩個後端上的行為一致時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- csharp
- 領域
- api, backend
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100