問題タブ [cythonize]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - Cython のリストからメソッドを呼び出す
Cython の prange ループで同じ入力を受け取る 3 つの関数を並列で実行したいと思います。TV
これらは、同じ変数を使用して、同じ変数およびに値を追加しdu
ます。このコードの目的は、4 つの主な方向でピクセルの勾配を計算し、ピクセルごとに合計変動を計算することです。
そのために、メソッド名のリストを作成し、このリストを反復処理します。私はこのコードを持っています:
純粋な Python では動作しますが、Cython はコンパイルで失敗します:
それをする意味はありますか?
編集:
この概念実証は次のように機能します。