Commit ce5a2d6e authored by Tomas Farago's avatar Tomas Farago
Browse files

[misc] add missing file nabu.misc.utils.py

parent 4e3379d8
Pipeline #24597 passed with stage
in 52 seconds
#
# silx.opencl.utils.ConvolutionInfos cannot be used as long as
# silx.opencl instantiates the "ocl" singleton in __init__,
# leaving opencl contexts all over the place in some cases.
#
# so for now: copypasta
#
class ConvolutionInfos(object):
allowed_axes = {
"1D": [None],
"separable_2D_1D_2D": [None, (0, 1), (1, 0)],
"batched_1D_2D": [(0,), (1,)],
"separable_3D_1D_3D": [
None,
(0, 1, 2),
(1, 2, 0),
(2, 0, 1),
(2, 1, 0),
(1, 0, 2),
(0, 2, 1)
],
"batched_1D_3D": [(0,), (1,), (2,)],
"batched_separable_2D_1D_3D": [(0,), (1,), (2,)], # unsupported (?)
"2D": [None],
"batched_2D_3D": [(0,), (1,), (2,)],
"separable_3D_2D_3D": [
(1, 0),
(0, 1),
(2, 0),
(0, 2),
(1, 2),
(2, 1),
],
"3D": [None],
}
use_cases = {
(1, 1): {
"1D": {
"name": "1D convolution on 1D data",
"kernels": ["convol_1D_X"],
},
},
(2, 2): {
"2D": {
"name": "2D convolution on 2D data",
"kernels": ["convol_2D_XY"],
},
},
(3, 3): {
"3D": {
"name": "3D convolution on 3D data",
"kernels": ["convol_3D_XYZ"],
},
},
(2, 1): {
"separable_2D_1D_2D": {
"name": "Separable (2D->1D) convolution on 2D data",
"kernels": ["convol_1D_X", "convol_1D_Y"],
},
"batched_1D_2D": {
"name": "Batched 1D convolution on 2D data",
"kernels": ["convol_1D_X", "convol_1D_Y"],
},
},
(3, 1): {
"separable_3D_1D_3D": {
"name": "Separable (3D->1D) convolution on 3D data",
"kernels": ["convol_1D_X", "convol_1D_Y", "convol_1D_Z"],
},
"batched_1D_3D": {
"name": "Batched 1D convolution on 3D data",
"kernels": ["convol_1D_X", "convol_1D_Y", "convol_1D_Z"],
},
"batched_separable_2D_1D_3D": {
"name": "Batched separable (2D->1D) convolution on 3D data",
"kernels": ["convol_1D_X", "convol_1D_Y", "convol_1D_Z"],
},
},
(3, 2): {
"separable_3D_2D_3D": {
"name": "Separable (3D->2D) convolution on 3D data",
"kernels": ["convol_2D_XY", "convol_2D_XZ", "convol_2D_YZ"],
},
"batched_2D_3D": {
"name": "Batched 2D convolution on 3D data",
"kernels": ["convol_2D_XY", "convol_2D_XZ", "convol_2D_YZ"],
},
},
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment