arrayfire / arrayfire/arrayfire-python
Return fixed length tuple from array.dims()?
- 主要言語
- Python
- スター
- 422
- フォーク
- 63
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Hi,
Could you consider changing array.dims() to return a fixed length tuple, like (3,4,1,1)? Currently it's necessary to check the length of the returned tuple before indexing it to get the size of a specific dimension.
```
>>> import arrayfire as af
>>> aa = af.randu(3,4,1)
>>> aa.dims()
(3, 4)
>>> bb = af.randu(3,4,2)
>>> bb.dims()
(3, 4, 2)
>>>
```
Something like this...
```
>>> def dims(arr):
>>> return arr.dims() + ((1,)*(4-len(arr.dims())))
>>> dims(aa)
(3,4,1,1)
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Start at the Python binding entry point for array.dims() and inspect how it currently exposes ArrayFire dimensions. Use the examples in the issue to confirm the intended four-element behavior and its effect on existing callers. Done means the API consistently returns the requested fixed-length tuple and its behavior is covered by the relevant tests.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100