Expand description
Convolutions and windowed reductions on row-major buffers, with XLA’s semantics.
As in crate::array, shapes are assumed to have been checked (by shape
inference); the functions panic on inconsistent inputs.
Structs§
- Conv
Dims - The dimension numbers of a convolution, as JAX’s
ConvDimensionNumbers: each spec lists dimensions of an operand or of the result. - Conv
Window - The window of a convolution: one entry per spatial dimension.
- Window
- The window of a windowed reduction: one entry per operand dimension.
Functions§
- conv_
general_ dilated conv_general_dilated: XLA’s convolution, with feature groups (the input features and the output features are split intofeature_group_countgroups, and output groupgsees input groupg) and batch groups (the input batch is split intobatch_group_countgroups, the major part of the batch dimension, and output feature groupgsees batch groupg).- conv_
shape - The shape of the result of a convolution.
- conv_
terms - The products that
conv_general_dilatedsums, in its order: for each element of the result (row-major),[result, lhs, rhs]positions of the operands’ elements whose products are added, from zero, in this order (to compile small convolutions as a table: the same sums as the kernel, bit for bit, for the types it does not fuse or widen, that is, other thanf64,f16, andbf16). - dilate_
dim - The size of a dimension of size
dafter dilation:1 + dilation * (d - 1), or 0 for an empty dimension. - reduce_
window reduce_window_sum,reduce_window_max,reduce_window_min: combines the elements of each window, from the identity, in row-major order of the window (padding and holes are skipped). This is XLA’s order on CPU for windows without padding; with padding, XLA sums some windows in another order.- reduce_
window_ shape - The shape of the result of a windowed reduction.
- select_
and_ gather_ add select_and_gather_add: for each window ofoperand, the element oftangentsat the position of the selected element ofoperand(ge: the first maximum, otherwise the first minimum), or 0 if the window covers no element.- select_
and_ scatter_ add select_and_scatter_add: for each window ofoperand(of shapeshape), selects an element (ge: the first maximum, otherwise the first minimum, as XLA’sselect_and_scatterwith the comparison asselect) and adds the window’s element ofsourceto it in the result (zeros elsewhere). Windows are visited in row-major order.- stride_
dim - The number of windows of size
windowwith stepstridein a dimension of sized:max(0, (d - window) / stride + 1).