Python wrappers
Public Python APIs implemented by this engine symbols.Autograd node for Fold (col2im), the adjoint of Unfold.
fold scatter-adds patches back into an image, so its transpose is
exactly the unfold gather — the backward runs unfold_forward with
the same hyper-parameters.
Members
output_size_ : vector<int>
Spatial extent of the folded output, per axis.
kernel_, stride_, pad_, dilation_ : vector<int>
Per-axis hyper-parameters, as for UnfoldBackward.
Instance methods
2Backward — the im2col gather that recovers the column-matrix gradient.
Parameters
grad_ outStorageUpstream gradient shaped like the folded image.
Returns
vector<Storage>Single-element vector containing dx shaped (B, C * prod(K), prod(O)).
Graph-mode backward: the adjoint is the other op of the pair (fold for unfold, unfold for fold), recorded so it can be differentiated again.